Stretch tegne et grafisk til et printer.canvas er svært dårlig. Her er en bedre solution.procedure DrawImage (lerret: TCanvas; DestRect: TRect; ABitmap: TBitmap); Var Header, Bits: Pointer; HeaderSize: DWORD; BitsSize: DWORD; begynne GetDIBSizes (ABitmap.Handle, HeaderSize, BitsSize); GetMem (Header, HeaderSize); GetMem (Bits, BitsSize); prøv GetDIB (ABitmap.Handle, ABitmap.Palette, Header ^, Bits ^); StretchDIBits (Canvas.Handle, DestRect.Left, DestRect.Top, DestRect.Right, DestRect.Bottom, 0, 0, ABitmap.Width, ABitmap.Height, Bits, TBitmapInfo (Header ^), DIB_RGB_COLORS, SRCCOPY); endelig FreeMem (Header); FreeMem (Bits); end, end; Anmeldelser
Previous:Synkende fra TObjectList
Next Page:GetFileVersion