Hi Roger/ALL
What value should I set DC_BitmapTransparentColor() to completely remove background around the bitmaps of my application toolbar ?
I sed DC_BitmapTransparentColor(XBPSYSCLR_TRANSPARENT) but some small background still exist around the bitmaps of our application menu
Thanks
Joe
DC_BitmapTransparentColor()
Re: DC_BitmapTransparentColor()
have a look at \Source\SYS\axctrls.prg and search for "TransparentColor"
Code: Select all
METHOD XbpToolBar:GetTransparentColor()
METHOD XbpToolBar:SetTransparentColor( Value )
greetings by OHR
Jimmy
Jimmy
Re: DC_BitmapTransparentColor()
Set it to the color you used for the background. For instance, if the background is black, use DC_BitmapTransparentColor( { 0, 0, 0 } ), and if it's white, use DC_BitmapTransparentColor( { 255, 255, 255 } ). All pixels with this color will be transparent if a bitmap is shown. So, white or black may not be good ideas.
Use a color for the bitmap background which is not used elsewhere in the bitmap(s).

Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: DC_BitmapTransparentColor()
Hi Jimmy
I have studied your suggestion but do not know how to apply it to solve my problem
Joe
I have studied your suggestion but do not know how to apply it to solve my problem
Joe
Re: DC_BitmapTransparentColor()
Bitmap does not have Transparency ... only PNG or GIFunixkd wrote:I have studied your suggestion but do not know how to apply it to solve my problem
as Tom say you can set DC_BitMapTransparentColor() for a Image.
you can change o:transparentClr default GRA_CLR_INVALID when display Image
you have to do it for each Image
---
XbpToolBar() have o:transparentColor, like o:transparentClr, but for all "Additem" or "Image" (read help file)
Code: Select all
ACCESS METHOD GetTransparentColor VAR TransparentColor
ASSIGN METHOD SetTransparentColor VAR TransparentColor
METHOD XbpToolBar:SetTransparentColor( Value )
...
::ImageList:MaskColor := Value
METHOD XbpToolBar:GetTransparentColor()
...
ValuePrev := ::ImageList:MaskColor
greetings by OHR
Jimmy
Jimmy
Re: DC_BitmapTransparentColor()
Joe, the bitmaps of your toolbar artwork don't have a background in a technical manner. Bitmaps are just maps of pixels, and those pixels are nothing else but color information for picture points. A 200 x 200 pixel bitmap consists of 40,000 pixels, which are represented by 40,000 numbers for the color of each point of the picture - from left to right and top to bottom. The number is between 0 and 16777216, where 0 is black and 16777216 is white. In Xbase++, this is a little differnent, since the numbers below 16777216 are reserved for constant colors, so the values there are between 16777216 (black) and 33554431 (white). The Xbase++-function GraMakeRGBColor() gives you those numbers for RGB-color-codes like 0,0,0 (black) or 255,255,255 (white) with ? GraMakeRGBColor({0, 0, 0 }) which returns 16777216.
Your bitmaps must have one single color in common for the background area. That means, you may have to fill the backgrounds of all bitmaps with the same color, like maybe black (0, 0, 0). If done so, you can set black to the bitmap transparency color from now on (DC_BitmapTransparentColor({0, 0, 0}). The Xbase++ image processor will remove all pixels having this color code and show the color of the background - the objects behind the bitmaps, maybe of the owner. If black is not the bitmap background, but somewhere else in the bitmaps, those pixels will (also) be transparent. If the transparency color is not in your bitmaps, they will not have any transparency.
Maybe you show some of your bitmaps. A simple painting program with a color picker will help to find the background color.
Your bitmaps must have one single color in common for the background area. That means, you may have to fill the backgrounds of all bitmaps with the same color, like maybe black (0, 0, 0). If done so, you can set black to the bitmap transparency color from now on (DC_BitmapTransparentColor({0, 0, 0}). The Xbase++ image processor will remove all pixels having this color code and show the color of the background - the objects behind the bitmaps, maybe of the owner. If black is not the bitmap background, but somewhere else in the bitmaps, those pixels will (also) be transparent. If the transparency color is not in your bitmaps, they will not have any transparency.
Maybe you show some of your bitmaps. A simple painting program with a color picker will help to find the background color.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."