GBmp GDIPLUS

Post Reply
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

GBmp GDIPLUS

Post by Silvio.Falconi »

I use Gbmp class to load a PNG FILE

and I use drawimage to show the image

oGraphics:DrawImage( aImages[i] , 1, aPos[i] )

the background of the image is white

how I can make to make it transparent ?

oPen := Pen():New( 255, 0, 0, 255 ) // nTransparency, nRed, nGreen, nBlue

where I must insert oPen ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: GBmp GDIPLUS

Post by ukoenig »

Silvio,

I tested all possible combinations.
I couldn't find any painting-problem.
Transparent PNG on image, lines, ellipse, rects ....
colored circles with defined transparent works as well ( red border with green )

Image

best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: GBmp GDIPLUS

Post by Silvio.Falconi »

Uwe,

I tried but at init run ok the transparent

Image



then when I call the animation all is wrong

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: GBmp GDIPLUS

Post by ukoenig »

Silvio,

on init the first positions of the images are shown.
Next You move the images on a painted background of the images shown at startup.
Because the images are transparent, the not covered images BEHIND the new ones are shown.
It will only work, if You RESTORE the original brush of the window or dialog inside the used area
BEFORE painting new images.
Using Your sample, You can REFILL the used area with green, before painting the new images.
It can be a colored bitmap ( green ) with the size of the used area.
A other solution : a colored background of the images ( green )
It can be done easy with PIXELFORMER.

best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: GBmp GDIPLUS

Post by ukoenig »

Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Post Reply