Results 1 to 3 of 3

Thread: [RESOLVED] TransparentBlt - Does nothing

  1. #1
    PowerPoster
    Join Date
    Jan 08
    Posts
    6,781

    Resolved [RESOLVED] TransparentBlt - Does nothing

    I'm using Windows XP/SP2 - VB6.0

    On a Form I have two Pictureboxes, Picture1 and Picture2. The Form, Picture1, and Picture2 have their ScaleMode = vbPixels. Picture1 and Picture2 have their AutoRedraw = True. Picture1 has a multi-colored bitmap (red, blue, yellow, green, cyan, magenta) of circles. Picture2 has no bitmap.

    The code line I run:

    Code:
     TransparentBlt _
      Picture2.hdc, _
      0, 0, _
      Picture1.ScaleWidth, _
      Picture1.ScaleHeight, _
      Picture1.hdc, _
      0, 0, _
      Picture1.ScaleWidth, _
      Picture1.ScaleHeight, _
      RGB(255, 0, 0)
    Picture2 is not changed.

    Am I using the function incorrectly or doe it simply not work?
    The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved


    When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day

  2. #2
    PowerPoster
    Join Date
    Feb 06
    Posts
    8,577

    Re: TransparentBlt - Does nothing

    Should work on Windows 98 and later, and in some cases even on Win95 and NT 4.0. I use it for a few things and it always seems to work fine here.

    Ahh, you said you have AutoRedraw on. Turn it off in the destination.
    Attached Files Attached Files

  3. #3
    PowerPoster
    Join Date
    Jan 08
    Posts
    6,781

    Re: TransparentBlt - Does nothing

    Yes, that made it work. I can see that the function needs to be executed in the Picture2.Paint() event in order to retain the results in case of things getting in the way.

    Thanks, dilettante
    The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved


    When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day

Posting Permissions

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