In honor of the death of Windows XP (which means there is no excuse for VB6 programmers to ignore these techniques any more) here is an example of some of the simple things you can use the Windows Image Acquisition Library 2.0 for.
WIA can do other things for you as well such as trivially extract JPEG EXIF data including thumbnail images and perform many scanner and still-image camera operations. In particular the loading of PNG or TIFF images and saving images in GIF, JPEG, and TIFF are provided via WIA.
However this sample program only shows a few of the things WIA can help you do with little code.
If you can find the old WIA 2.0 SDK you can deploy the library back as far as WinXP SP1 machines if necessary. However the download was pulled from Microsoft Downloads some time ago.
This demo illustrates a couple of things such as image loading with WIA, extracting a Form or PictureBox image to a WIA ImageFile object for use in operations such as saving to disk, and simple use of WIA's ImageProcess object's "Stamp" filter for compositing with transparency and PNG alpha blending.
It doesn't go into the details for other filters such as Convert, RotateFlip, Crop, Scale, etc. but those are documented elsewhere. Filters can even be applied in a group to perform multiple operations at once.
By using the persistent bitmap of a Form (and a smaller PictureBox) this demo shows how you can intermix WIA Stamp with VB6 drawing operations in "layers." Note that GIF transparency and PNG transparency and alpha channel blending are supported.
Screenshot of the demo. Note that this capture was compressed down
to 8-bit color and the actual results look better.
Here all of the images are loaded from disk files. However you can also use WIA to load images from custom resources, or even from sources such as downloaded data without writing them to disk first.
Last edited by dilettante; Apr 8th, 2014 at 01:56 PM.
WIA is not a general replacement for GDI+ wrapper libraries, especially for things like antialiased drawing and text operations. However it does make a number of useful things easily accessible to VB6 programmers with just a few lines of code.
thx for all the info about WIA you have provided, i think WIA is very handy and neat. using google you don't find that much samples but maybe you could help out since you have more experience with WIA.
i would like to use opacity, not just transparency.
example:
you have a form with a picture, then you load a PNG and you want this picture to be a bit see-through. that picture could be a nice frame, but would look better if the frame was a bit transparent, not solid. is there a way to do it with WIA?
I suggest you ask this in the VB6 Q&A forum, perhaps with more details of exactly what you want. WIA might not offer the necessarily flexibility, so you may get several better alternatives.