And we need a solution for loading GIF too.
EMG
And we need a solution for loading GIF too.
EMG
when they loaded look good right?
No. As I already wrote, with FILoadImage() the GIFs look fine while with GDIP_LOADFROMFILE() don't.
EMG
Function Main ()
local ownd
local oimg
DEFINE WINDOW oWnd TITLE "Testing GDI+ Class" FROM 5,5 TO 500, 890 PIXEL ;
COLOR CLR_GRAY, CLR_GRAY
@ 20,12 button "crear" size 40,20 pixel Action oBmpLoadFromFile( oImg, 640, 400 )
@ 20 ,130 Button "salir" Action ownd:end() size 40,20 pixel
@ 3, 28 BITMAP oimg FILE "" size 640,400 of oWnd
ACTIVATE WINDOW oWnd
Return (nil)
Function oBmpLoadFromFile( oBmp, nWidth, nHeight )
local hBmpOld := oBmp:hBitmap
local hPalOld := oBmp:hPalette
local ohBmp
local hBmp := 0
local cFile:= cGetfile("coge","*.*")
if ! Empty( cFile )
ohBmp := GDIBmp():new(cFile)
if ( ! Empty( nWidth ) .or. ! Empty( nHeight ) )
ohBmp:Resize( nWidth, nHeight )
endif
hBmp := ohBmp:GetGDIHbitmap()
ohBmp:End()
endif
oBmp:hBitmap := hBmp
oBmp:hPalette := 0
if ! Empty( hBmpOld )
PalBmpFree( hBmpOld, hPalOld )
endif
obmp:HasAlpha()
obmp:refresh()
RETURN nilPlease open the GIF with any image viewer and compare with your sample. You'll see the difference.
EMG

Too small to see any differences. Anyway, try to send me your EXE to test it here.
EMG
the program :
for jpg,gif,tif,bmp,ico files
Your EXE seems to work fine! Can I have the source code, please? The one that you gave me is different.
EMG
Enrico , code here :https://www.dropbox.com/s/tpbv93i3gxv187y/gdiplus4.prg?dl=0
with emf fines work fine also.
Ok, it doesn't work fine here. So you are not using the official FWH build 4 from Fivetech website, right?
EMG
1) If a programmer prefers to use FreeImage, he can set UseGDI( .f. ). We provided this toggle so that the programmer can choose what he considers better.
2) Mr EMG is comparing the GDI+ code as adopted by FWH with the quality of FreeImage.
3) Possible that Mr Manuel has improved code. If Mr Manuel feels FWH code needs improvement, we would be glad to incorporate his contribution.
Enrico , All code uses the official version fwh build 4 .
So I'm lost. I don't know what the difference could be. I'm using official FWH build 4 and BCC 7.1. Tried with Harbour and xHarbour. ![]()
EMG
enrico , please send your exe file to compare here. I use harbour , bcc7 and fwh 15.09 build4 also. ¿? ![]()