![]() A TOpenDialog and a TButton to load an image to be manipulated.įirst of all, add the following code to the OnClick event handlers of the load button, so you can open any bitmap you want.Set the TNumberBox.Max property to 360 and the TNumberBox.Min property to -360. A TNumberBox to choose the rotation degree and a TButton to call the Rotate method.A TColorComboBox to choose the color to fill the TBitmap.Two TImage objects: one to display the initial bitmap, and one to display the results of the manipulation methods.To build and test this example, create a Multi-Device Application - Delphi, and add the following on the form: The following code resizes pf32bit bitmaps with transparency using TWICImage, at a much better quality than can be achieved with StretchDraw for example or anything else I have tried. The TBitmap manipulation functions are: ReplaceOpaqueColor, FlipHorizontal, FlipVertical, InvertAlpha, Rotate. Delphi partially encapsulates this functionality into the TWICImage class of Vcl.Graphics which is a TGraphics descendent. This example shows how to use the TBitmap manipulation functions and their results.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |