[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Question About TRANSPARENT Bitmaps

Is it Possible to use more than one Transparent COlor when I Paint the Bitmap??

I trying with the TransparentBlt() Function for the moment.

But can I Use more than one COLORREF??
  • 2
1 Solution
why would you use more then one? the other color can just be made the transparent color, no?
SnurreAuthor Commented:
So I coulden't use like COLORREF RGB(255, 255, 255) | RGB(255, 1, 255);

that's a bit-wise or you'll be creating a new color from that
that should make white still cause your bit-wise or'ing a full colorref variable
0x00ffffff with 0x00ff01ff
colorref is stored backwards like:
0x00bbggrr (that has nothing to do with it im just stating that :o\)
what im saying is why not load the image into a paint program and use a colorreplacer, replace all 255,1,255 with 255,255,255
there should only be one transparent color.
the only other option you have (besides writing code to getpixel and setpixel each one if they arent one of those two colors) is to use bitblt and mask the image on. i think it'd be better to do what your doing just change the color on that image though, but if you want.
make a copy of that image in a paint program and set all the areas you DON'T want to be visisble (the transparent areas) to white, all areas that will be visible will be set to black. some paint programs do this for you with a little touchup needed maybe.
that's you mask image, what you do is use bitblt and set that mask image on the hdc first in the same spot as you want the regular image.
now you put the regualr one on
all that will show is what was in the black area of the mask image from the regular image, a transparent bitmap.
No comment has been added lately, so it's time to clean up this TA. I will
leave a recommendation in the Cleanup topic area that this question is:

Answered: Points to PlanetCpp: Grade A

Please leave any comments here within the next seven days.

Experts: Silence means you don't care. Grading recommendations are made in light
of the posted grading guidlines (http://www.experts-exchange.com/help.jsp#hi73).


-bcl (bcladd)
EE Cleanup Volunteer

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now