Verovatno si koristio standardne tehnike stampe koje su objasnjene lepo u knjizi Delphi5, kao sto je npr.:
with Printer do begin
BeginDoc;
Canvas.Draw((PageWidth - Bmp.Width ) div 2,
(PageHeight - Bmp.Height) div 2,
Bmp);
EndDoc;
end;
Problem je sto to nece da funkcionise za Windows2000 i WinXP, dok za 98-smicu sve funkcionise. Problem lezi u tome sto sada moras koristiti DIB (device independent bitmap)
sto je Microsoft na svojoj stranici "naglasio"
http://support.microsoft.com/d...95/8/30.asp&NoWebContent=1
Probaj nesto ovako:
procedure TForm1.Button1Click(Sender: TObject);
var
Info : PBitmapInfo;
InfoSize : DWORD;
Image : Pointer;
ImageSize : DWORD;
Bits : HBITMAP;
bmp : TBitmap;
begin
bmp:=TBitmap.Create;
bmp.LoadFromFile('......');
Bits := bmp.Handle;
GetDIBSizes(Bits, InfoSize, ImageSize);
Info := AllocMem(InfoSize);
try
Image := AllocMem(ImageSize);
try
GetDIB(Bits, 0, Info^, Image^);
StretchDIBits(Printer.Canvas.Handle,
5, 30, bmp.Width, bmp.Height,
0, 0, bmp.Width, bmp.Height,
Image, Info^, DIB_RGB_COLORS, SRCCOPY);
finally
FreeMem(Image, ImageSize);
end;
finally
FreeMem(Info, InfoSize);
bmp.Free;
end;
end;
Obrati paznju na StretchDIBits() API, jer ti je on (bar ja tako mislim) resenje.