I use to show an png file with GDIPLUS
oGraphics:DrawImage( )
How set the image (png) transparent with this function ?
#include "FiveWin.ch"
#include "constant.ch"
static oWnd,oBmp
Function Main()
DEFINE BITMAP oBmp FILENAME ".\bitmaps\cucina.bmp"
DEFINE WINDOW oWnd FROM 10, 10 TO 48,110 TITLE "SLOT 5 REELS" STYLE WS_POPUP
DrawImage(oBmp)
ACTIVATE WINDOW oWnd ;
on init DrawImage(oWnd)
return nil
function DrawImage(ownd)
local hdc:= oWnd:getdc()
local oGraphics := Graphics():New( ownd:hDC )
local oImage:= GDIBmp():new(,"cuoco" ) // added image logo.png
oGraphics:DrawImage( oImage , 60 ,60 )
oGraphics:destroy()
oWnd:releasedc()
Return nil
G:\Gdiplus_2>if not exist obj md obj
G:\Gdiplus_2>c:\work\bcc582\bin\make -f TESTGDI.rmk
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
echo off
echo c:\work\bcc582\bin\c0w32.obj + > b32.bc
echo obj\TESTGDI.obj, + >> b32.bc
echo TESTGDI.exe, + >> b32.bc
echo TESTGDI.map, + >> b32.bc
echo c:\work\fwh\lib\Fivehx.lib + >> b32.bc
echo c:\work\fwh\lib\FiveHC.lib + >> b32.bc
echo c:\work\xharbour\lib\rtl.lib + >> b32.bc
echo c:\work\xharbour\lib\vm.lib + >> b32.bc
echo c:\work\xharbour\lib\GTcgi.lib + >> b32.bc
echo c:\work\xharbour\lib\GTgui.lib + >> b32.bc
echo c:\work\xharbour\lib\GTpca.lib + >> b32.bc
echo c:\work\xharbour\lib\GTstd.lib + >> b32.bc
echo c:\work\xharbour\lib\GTwin.lib + >> b32.bc
echo c:\work\xharbour\lib\GTwvt.lib + >> b32.bc
echo c:\work\xharbour\lib\gtgui.lib + >> b32.bc
echo c:\work\xharbour\lib\lang.lib + >> b32.bc
echo c:\work\xharbour\lib\macro.lib + >> b32.bc
echo c:\work\xharbour\lib\rdd.lib + >> b32.bc
echo c:\work\xharbour\lib\dbfntx.lib + >> b32.bc
echo c:\work\xharbour\lib\dbfcdx.lib + >> b32.bc
echo c:\work\xharbour\lib\dbffpt.lib + >> b32.bc
echo c:\work\xharbour\lib\hbsix.lib + >> b32.bc
echo c:\work\xharbour\lib\debug.lib + >> b32.bc
echo c:\work\xharbour\lib\common.lib + >> b32.bc
echo c:\work\xharbour\lib\pp.lib + >> b32.bc
echo c:\work\xharbour\lib\codepage.lib + >> b32.bc
echo c:\work\xharbour\lib\pcrepos.lib + >> b32.bc
echo c:\work\xharbour\lib\ct.lib + >> b32.bc
echo c:\work\xharbour\lib\hbzip.lib + >> b32.bc
echo c:\work\xharbour\lib\zlib.lib + >> b32.bc
echo c:\work\xharbour\lib\libmisc.lib + >> b32.bc
echo c:\work\xharbour\lib\tip.lib + >> b32.bc
echo c:\work\xharbour\lib\png.lib + >> b32.bc
echo c:\work\bcc582\lib\cw32.lib + >> b32.bc
echo c:\work\bcc582\lib\import32.lib + >> b32.bc
echo c:\work\bcc582\lib\uuid.lib + >> b32.bc
echo c:\work\bcc582\lib\psdk\odbc32.lib + >> b32.bc
echo c:\work\bcc582\lib\psdk\rasapi32.lib + >> b32.bc
echo c:\work\bcc582\lib\psdk\nddeapi.lib + >> b32.bc
echo c:\work\bcc582\lib\psdk\msimg32.lib + >> b32.bc
echo c:\work\bcc582\lib\psdk\iphlpapi.lib + >> b32.bc
echo c:\work\bcc582\lib\psdk\gdiplus.lib + >> b32.bc
echo c:\work\bcc582\lib\psdk\psapi.lib, >> b32.bc
echo c:\work\bcc582\lib\PSDK\shell32.lib + >> b32.bc
IF EXIST TESTGDI.res echo TESTGDI.res >> b32.bc
c:\work\bcc582\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external 'SHCreateDirectoryExA' referenced from C:\WORK\FWH\LIB\FIVEHC.LIB|MKDIR
Error: Unresolved external '_HB_FUN_HB_NUMTOHEX' referenced from C:\WORK\FWH\LIB\FIVEHX.LIB|TGDIPLUS
RLINK32: Unsupported 16bit resource in file "C:\WORK\BCC582\LIB\PSDK\SHELL32.LIB"
Error: Unknown RLINK32 error
** error 2 ** deleting TESTGDI.exe
#Borland make sample, (c) FiveTech Software 2005
HBDIR=i:\xharbour
#BCDIR=i:\bcc63
#BCDIR=i:\bcc65
BCDIR=i:\bcc82
FWDIR=i:\fwh
.path.OBJ = .\obj
.path.PRG = .\
.path.CH = $(FWDIR)\include;$(HBDIR)\include
.path.C = .\
.path.rc = .\
PRG = \
TESTGDI.PRG
# C = \
# two.C
PROJECT : TESTGDI.exe
TESTGDI.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) TESTGDI.res
echo off
echo $(BCDIR)\bin\c0w32.obj + > b32.bc
# OBJ-Liste
# -------------
echo obj\TESTGDI.obj, + >> b32.bc
echo TESTGDI.exe, + >> b32.bc
echo TESTGDI.map, + >> b32.bc
# Fivewin Lib`s für xHARBOUR
# --------------------------------------
echo $(FWDIR)\lib\Fivehx.lib + >> b32.bc
echo $(FWDIR)\lib\FiveHC.lib + >> b32.bc
# xHARBOUR-Lib`s
# -----------------------
echo $(HBDIR)\lib\rtl.lib + >> b32.bc
echo $(HBDIR)\lib\vm.lib + >> b32.bc
echo $(HBDIR)\lib\GTcgi.lib + >> b32.bc
echo $(HBDIR)\lib\GTgui.lib + >> b32.bc
echo $(HBDIR)\lib\GTpca.lib + >> b32.bc
echo $(HBDIR)\lib\GTstd.lib + >> b32.bc
echo $(HBDIR)\lib\GTwin.lib + >> b32.bc
echo $(HBDIR)\lib\GTwvt.lib + >> b32.bc
echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
echo $(HBDIR)\lib\lang.lib + >> b32.bc
echo $(HBDIR)\lib\macro.lib + >> b32.bc
echo $(HBDIR)\lib\rdd.lib + >> b32.bc
echo $(HBDIR)\lib\dbfntx.lib + >> b32.bc
echo $(HBDIR)\lib\dbfcdx.lib + >> b32.bc
echo $(HBDIR)\lib\dbffpt.lib + >> b32.bc
echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
echo $(HBDIR)\lib\debug.lib + >> b32.bc
echo $(HBDIR)\lib\common.lib + >> b32.bc
echo $(HBDIR)\lib\pp.lib + >> b32.bc
echo $(HBDIR)\lib\codepage.lib + >> b32.bc
echo $(HBDIR)\lib\pcrepos.lib + >> b32.bc
echo $(HBDIR)\lib\ct.lib + >> b32.bc
echo $(HBDIR)\lib\hbzip.lib + >> b32.bc
echo $(HBDIR)\lib\zlib.lib + >> b32.bc
echo $(HBDIR)\lib\libmisc.lib + >> b32.bc
echo $(HBDIR)\lib\tip.lib + >> b32.bc
echo $(HBDIR)\lib\png.lib + >> b32.bc
# Uncomment these two TESTGDI to use Advantage RDD
# echo $(HBDIR)\lib\rddads.lib + >> b32.bc
# echo $(HBDIR)\lib\Ace32.lib + >> b32.bc
echo $(BCDIR)\lib\cw32.lib + >> b32.bc
echo $(BCDIR)\lib\import32.lib + >> b32.bc
echo $(BCDIR)\lib\uuid.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\rasapi32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\gdiplus.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\psapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\shell32.lib, >> b32.bc
IF EXIST TESTGDI.res echo TESTGDI.res >> b32.bc
$(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
# $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
del b32.bc
.PRG.OBJ:
$(HBDIR)\bin\harbour $< /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include > clip.log
$(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c
.C.OBJ:
echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
$(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
del tmp
TESTGDI.res : TESTGDI.rc
$(BCDIR)\bin\brc32.exe -r TESTGDI.rc
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 112 guests