Delphi doesn't provide image processing component, so we have to write the processing algorithm by ourself, that's why this blog is written. Many third party image processing component are available, but we don't need it as we are going to learn on how to make it. To design the graphical user interface, Delphi (both Delphi pro and Turbo Delphi Explorer) provides TImage component.
This component has Picture property that can be used to store image data. Picture property has a method called LoadFromFile that can be used to retrieve image data from a file. Other important TPicture sub-properties are:
This component has Picture property that can be used to store image data. Picture property has a method called LoadFromFile that can be used to retrieve image data from a file. Other important TPicture sub-properties are:
- Height, represent the value of the image's height in pixel unit.
- Width, represent the value of the image's width in pixel unit.
- Bitmap, contain the data format information and the pixels values of the image.
- pf1bit The bitmap is a device-independent bitmap with one bit per pixel (black and white palette)
- pf8bit The bitmap is a device-independent bitmap that uses a 256color palette.
- pf24bit The bitmap is a device-independent true-color bitmap that uses 24 bits per pixel.
When an image is first loaded from a file, the format will be the original format stored on that file, but we can change the bitmap format, and the data in the bitmap will be changed accordingly. Just be careful because this format conversion is not reversible.
0 comments:
Post a Comment