我用以下列印圖片時圖像支旋轉了180度,這是為什麼?
X := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;
Y := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;
R := Rect(300,300,dbimage1.Picture.Width*x+100,dbimage1.Picture.Height*y+100);
Printer.Canvas.StretchDraw(R,dbimage1.Picture.Bitmap);
X := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;
Y := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;
R := Rect(300,300,dbimage1.Picture.Width*x+100,dbimage1.Picture.Height*y+100);
Printer.Canvas.StretchDraw(R,dbimage1.Picture.Bitmap);
procedure xxx.Print(PixelsPerInch: Integer);
const
pagetype = 'A4';
var
ScaleX, ScaleY: Integer; //打印机 div 屏幕
R: TRect;
yw, yh: integer;
begin
yw := m_BitMap.Width * m_Percent div 100;
yh := m_BitMap.Height * m_Percent div 100;
BitMapClear;
Paint(m_BitMap.Canvas);
with Printer do
try
BeginDoc; // **
ScaleX := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;
ScaleY := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;
R := Rect(0, 0, yw * ScaleX, yh * ScaleY);
Canvas.StretchDraw(R, m_BitMap); // **
finally
EndDoc; // **
end;
end;//画线
procedure TForm1.Button1Click(Sender: TObject);
begin
canvas.MoveTo(1,1);
canvas.LineTo(100,100);
end;
Paint(m_BitMap.Canvas);
这两句去掉