I wish use GDI
how I can make to show and image Png trasparent on a Bitmap or Jpg ?
can Have a sample please
type
@ 10,072 BITMAP oBmp File "" size 50, 100 pixel // NOBORDER
oPen := Pen():New( 255, 0, 0, 255 ) // nTransparency, nRed, nGreen, nBlue
oImage1:= GDIBmp():new("sample.png" )
hDC[1]:= oBmp:GetDc()
oGraphics[1] := Graphics():New( hDC[1] )
n9:= -73
oGraphics[1]:DrawImage( oImage1 , 1, n9 )
if I use a sample.png with trasparency then I saw bad on the screen
Show an gdi trasparency
- Silvio.Falconi
- Posts: 7138
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Show an gdi trasparency
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
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
Re: Show an gdi trasparency
Silvio,
images on any background color, gradient, brush or image
I think sample 1 You are looking for ( with border =
)

regards
Uwe
images on any background color, gradient, brush or image
I think sample 1 You are looking for ( with border =


regards
Uwe

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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Silvio.Falconi
- Posts: 7138
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Show an gdi trasparency
wich command you use to show an image on another image with gdi commands ?
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
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
Re: Show an gdi trasparency
Try this ( NO border )
c_path := cFilePath(GetModuleFileName( GetInstance() ) )
c_path1 := c_Path + "IMAGES\"
FUNCTION DRAWIMAGE( oWnd )
LOCAL oGraphics1 := Graphics():New( oWnd:hDC )
LOCAL oGraphics2 := Graphics():New( oWnd:hDC )
LOCAL oImage1 := GDIBmp():new( c_path1 + "Logo.png" )
LOCAL oImage2 := GDIBmp():new( c_path1 + "Olga.jpg" )
//nTop := aRect[ 1 ]
//nLeft := aRect[ 2 ]
//nBottom := aRect[ 3 ]
//nRight := aRect[ 4 ]
// calculate or define the position from the calling window or dialog
// Olga -> top, left, img-width ( resized with factor ), img-height ( resized with factor )
oGraphics1:DrawImage( oImage2, aRect[1] + 150, aRect[2] + 470, oImage2:GetWidth() * 0.5, oImage2:GetHeight() * 0.5 )
// Logo oImage1 draw on top of oImage2
oGraphics2:DrawImage( oImage1, aRect[1] + 250, aRect[2] + 520, oImage1:GetWidth() * 0.3, oImage1:GetHeight() * 0.3 )
oGraphics1:Destroy()
oGraphics2:Destroy()
oImage1:End()
oImage2:End()
RETURN NIL
regards
Uwe
c_path := cFilePath(GetModuleFileName( GetInstance() ) )
c_path1 := c_Path + "IMAGES\"
FUNCTION DRAWIMAGE( oWnd )
LOCAL oGraphics1 := Graphics():New( oWnd:hDC )
LOCAL oGraphics2 := Graphics():New( oWnd:hDC )
LOCAL oImage1 := GDIBmp():new( c_path1 + "Logo.png" )
LOCAL oImage2 := GDIBmp():new( c_path1 + "Olga.jpg" )
//nTop := aRect[ 1 ]
//nLeft := aRect[ 2 ]
//nBottom := aRect[ 3 ]
//nRight := aRect[ 4 ]
// calculate or define the position from the calling window or dialog

// Olga -> top, left, img-width ( resized with factor ), img-height ( resized with factor )
oGraphics1:DrawImage( oImage2, aRect[1] + 150, aRect[2] + 470, oImage2:GetWidth() * 0.5, oImage2:GetHeight() * 0.5 )
// Logo oImage1 draw on top of oImage2
oGraphics2:DrawImage( oImage1, aRect[1] + 250, aRect[2] + 520, oImage1:GetWidth() * 0.3, oImage1:GetHeight() * 0.3 )
oGraphics1:Destroy()
oGraphics2:Destroy()
oImage1:End()
oImage2:End()
RETURN NIL
regards
Uwe

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.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Silvio.Falconi
- Posts: 7138
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Show an gdi trasparency
not use
LOCAL oPen := Pen():New( 255, 0, 0, 255 )
oPen:SetInset( )
for trasparency ???
???
LOCAL oPen := Pen():New( 255, 0, 0, 255 )
oPen:SetInset( )
for trasparency ???
???
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
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
Re: Show an gdi trasparency
Silvio,
pen is only used for border-drawing.
regards
Uwe
pen is only used for border-drawing.
regards
Uwe

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.
i work with FW.
If you have any questions about special functions, maybe i can help.