Results 1 to 4 of 4

Thread: Using BitBlt to overlay images

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    97

    Question Using BitBlt to overlay images

    Hi,

    I've got images of a oval button and an oval mask (white oval on a black background). I've also got a form with a background image. I'm wanting to cut the image of the button out using the mask and put it on the forms background image.

    I believe that BitBlt is the best of of doing it (i.e. store the button image and mask in invisible Picture Boxes and use BitBlt). Just not totally sure of how to implement it.

    Has anyone got any example code or links to code/threads, that would help me out with this.

    many thanks

    Paul

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Using BitBlt to overlay images

    Are you saying that the end result should be an oval shape with the form's bkg image drawn within the oval? If so, you mentioned the mask is white oval over black bkg. Does the non-mask have a white bkg?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    97

    Re: Using BitBlt to overlay images

    The end result should be the forms background image with the oval button on top. At the moment the mask is a white oval on a black background, but I can easily invert this if I need to. The forms background is blue and the oval button image is on black.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Using BitBlt to overlay images

    Mask is white on black bkg and non-mask is whatever on white bkg? Ok, I think this is what you want if I understand you correctly. Let us know.

    Blit the mask first using the ROP vbSrcPaint
    Blit non-mask using ROP vbSrcAnd
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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