Hiding the Quick Action and Description panel in Delphi.TManagedFormFixFormPositioningOnly class.TManagedFormDefaultEnvironmentDialog class.Edit keyboard macros with the Macro Library expert.Gegen Uploadfilter und europaweiten “Leistungsschutz”.dzMdbViewer – a viewer for MS Access database files.Beinahe-Unfälle und gefährliche Situationen.StretchBlt must be passed rather than FPreviewBmp.Handle. It took me hours to find out why in my original code StretchBlt failed with error code 6 (The handle is invalid). note that you need to use the Canvas handle of the bitmap,Ĭnv.Handle, BmpLeft, BmpTop, BmpWidth, BmpHeight,į, 0, 0, FPreviewBmp.Width, FPreviewBmp.Height,Ĭnv.TextOut(0, 0, Format('LastError: %d %s', )) SetStretchBltMode(cnv.Handle, COLORONCOLOR) set the StretchBlt mode (you basically always want COLORONCOLOR) calculate size and offsets so it is shown centered calculate the available size to display the bitmap I’ll focus on the Windows API function StretchBlt. There are various ways to draw a bitmap on a paintbox in Delphi. Yes, I know, this is far from news, but since I just spent several hours trying to find out why my code didn’t work, I’ll document it here so I can look it up later.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |