Results 1 to 5 of 5

Thread: VB6 - WIA "BlendPaint" Demo

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    VB6 - WIA "BlendPaint" Demo

    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.

    Name:  sshot.png
Views: 3034
Size:  55.9 KB

    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.
    Attached Files Attached Files
    Last edited by dilettante; Apr 8th, 2014 at 01:56 PM.

  2. #2

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 - WIA "BlendPaint" Demo

    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.

  3. #3

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 - WIA "BlendPaint" Demo

    A second demo showing how Filters can be "chained" in many cases.

    Name:  sshot.png
Views: 2024
Size:  46.3 KB

    Again, better quality "in person." This is a reduced-color image.

    Archive size due to image files used.
    Attached Files Attached Files
    Last edited by dilettante; Apr 8th, 2014 at 03:56 PM. Reason: reposted with 2 sizes of balls

  4. #4
    The Idiot
    Join Date
    Dec 2014
    Posts
    3,002

    Re: VB6 - WIA "BlendPaint" Demo

    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?

  5. #5

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 - WIA "BlendPaint" Demo

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width