The goal of my project is to resize any kind of image (jpeg/gif/png) in Delphi 6.
I have tried many ways but I could not get the ideal solution. Any clue of how to do that? It can be a simple command line tool, some code or a Delphi component.
I tried imagemagick: that's too heavy : 20 megas + dlls + registry.
I tried some snippet but mostly of them ONLY work for JPEG. I need gif/jpeg/png
I tried graphicEX but does not load my GIF
Using
Windows Imaging Component (WIC)
it may look like follows. This code supports encoders for BMP, GIF, PNG and JPEG formats, but it can be easily extended to the other formats (for the rest of the native encoder CLSIDs, look at the remarks section of theIWICBitmapEncoder
interface reference).Here's a prototype of the
ResizeImage
procedure used in this code example:And here's a short description of its parameters:
You can download an extended demo project showing the usage of the above code
from here
if you want.