Page 1 of 2

Problem Using DC_BitmapTransparentColor with DCPUSHBUTTONXP

Posted: Fri Aug 02, 2019 1:48 pm
by digitsoft
hello Roger
because if I am using DC_BitmapTransparentColor({255, 255, 255}) in DCPUSHBUTTONXP CAPTIONARRAY the photos are not transparent

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Fri Aug 02, 2019 7:02 pm
by rdonnay
I think this is an Xbase++ problem.

Are you saying that only {255,255,255} has the problem?

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 5:19 am
by digitsoft
I'm using this color for transparency {255,255,255} but it doesn't work for me


DC_BitmapTransparentColor( {255, 255, 255} )
@ 0.01+xRow,nCol+0.2+xCol DCPUSHBUTTONXP ;
CAPTIONARRAY aCaptions ;
SIZE 13.51, 4.35 ;
COLOR GRA_CLR_WHITE, aMenuVtaRapida[5] ; && GraMakeRGBColor({30,144,255}) ;
MOUSECOLOR GRA_CLR_BLACK, GraMakeRGBColor({245,205, 75}) ; && GraMakeRGBColor({30,144,255}) ;
MOUSEFONT '11.Calibri Bold' ;
BORDERCOLOR GRA_CLR_BLACK ;
ACTION PushMe( aApp,aMenuVtaRapida[1] ) ;
WHEN _When( aApp, !EMPT(aMenuVtaRapida[1]) ) ;
TOOLTIP aMenuVtaRapida[2] ;
PARENT oToolBarTop ;
MESSAGE aMenuVtaRapida[2] INTO oMsgBox




rdonnay wrote:I think this is an Xbase++ problem.

Are you saying that only {255,255,255} has the problem?

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 5:34 am
by Tom
Any chance to turn those bitmaps into icons, Nolberto? This works ways better.

Your bitmaps may get scaled, and that can have effects to the color pattern.

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 6:21 am
by digitsoft
Thanks tom
Because of your Answer, I cannot do this option because that photo is what the user assigned to the Product and can change.
Tom wrote:Any chance to turn those bitmaps into icons, Nolberto? This works ways better.

Your bitmaps may get scaled, and that can have effects to the color pattern.

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 6:32 am
by rdonnay

Code: Select all

I cannot do this option because that photo is what the user assigned to the Product and can change.
If your customer is the creator of the bitmap, then there is nothing that you can do to handle transparency.
The transparent color is determined by the creator of the bitmap.

You are adding to the complexity of your program by requiring that background colors be transparent.
I suggest that you paint the bitmaps on the buttons in the way that the customer creates the bitmaps.

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 7:54 am
by digitsoft
Thanks Roger
for his answer but I tell the client to put a white background on the maps
but it does not work.

rdonnay wrote:

Code: Select all

I cannot do this option because that photo is what the user assigned to the Product and can change.
If your customer is the creator of the bitmap, then there is nothing that you can do to handle transparency.
The transparent color is determined by the creator of the bitmap.

You are adding to the complexity of your program by requiring that background colors be transparent.
I suggest that you paint the bitmaps on the buttons in the way that the customer creates the bitmaps.

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 8:23 am
by rdonnay
Send me one of the bitmaps that has the white background.

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 10:53 am
by digitsoft
What the client does is copy the photo from the internet
I attach the Image
rdonnay wrote:Send me one of the bitmaps that has the white background.

Re: Problem Using DC_BitmapTransparentColor with DCPUSHBUTTO

Posted: Mon Aug 05, 2019 12:53 pm
by Auge_Ohr
hi,

i have test your "salsa linda.jpg" and use this Code

Code: Select all

PROCEDURE Main
LOCAL oBMP, cTitle := "test"

   oBMP := XbpBitmap():new():create()
   oBMP:Loadfile("salsa linda.jpg")

   oBMP:transparentClr := oBmp:getDefaultBGColor()

   NewGFXDocument( oBMP, cTitle )
RETURN
and got this
BMP_Transparent.JPG
BMP_Transparent.JPG (15.5 KiB) Viewed 12871 times