Sers,
versuche ein Bild zu drucken, hier erstmal der Quelltext:
Leider bekomme ich nichts aufm Drucker ausgegeben - und zwar gar nichts .......
Bitte dringenst um Hilfe - und da es nachher wichtige Dokumente sind darf das bitmap auch nicht pixeln oder sonstiges ....
Danke schonmal.
Gruß
Manu
versuche ein Bild zu drucken, hier erstmal der Quelltext:
Code:
procedure ResizeImage(newWidth,newHeight: Integer); begin SetStretchBltMode(Form2.Image2.Canvas.Handle, Halftone); StretchBlt(Form2.Image2.Canvas.Handle, 0,0,newwidth,newheight,Form2.Image1.Canvas.Handle,0,0,Form2.Image1.Width,Form2.Image1.Height,SRCCOPY); Form2.Image2.Picture.SaveToFile('***.bmp'); end; procedure PrintImage(iLeft, iTop: integer; Img: TImage); var GraphicRect: TRect; begin iLeft := iLeft; iTop := iTop; ZeroMemory(@GraphicRect, SizeOf(GraphicRect)); GraphicRect.Right:= Img.Picture.Graphic.Width; GraphicRect.Bottom:= Img.Picture.Graphic.Height; if Form2.PrintDialog1.Execute then begin printer.begindoc; Windows.SetMapMode(printer.Canvas.Handle, 1); printer.Canvas.CopyRect(Rect(iLeft, iTop, iLeft+ GraphicRect.Right * 10, iTop+ GraphicRect.Bottom * 10), Img.Canvas, GraphicRect); printer.enddoc; end; end; procedure TForm2.Button14Click(Sender: TObject); (*var zeile, x, y: integer; breite, hoehe, randlinks, randoben: integer;*) begin Image1.Picture.loadfromfile(ExtractFilePath(Application.ExeName) + '*.bmp'); ResizeImage(260,90); PrintImage(200,20,image2); }
Bitte dringenst um Hilfe - und da es nachher wichtige Dokumente sind darf das bitmap auch nicht pixeln oder sonstiges ....
Danke schonmal.
Gruß
Manu
Comment