Bad quality with GIF (and GDI+)
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Bad quality with GIF (and GDI+)
No. As I already wrote, with FILoadImage() the GIFs look fine while with GDIP_LOADFROMFILE() don't.
EMG
EMG
Re: Bad quality with GIF (and GDI+)
For me work fine .. ¿?
My code :
gif used for sample https://www.dropbox.com/s/mzibdx1j1h0lo ... 0.gif?dl=0
We show the image at 2X size to appreciate pixels
My code :
gif used for sample https://www.dropbox.com/s/mzibdx1j1h0lo ... 0.gif?dl=0
We show the image at 2X size to appreciate pixels
Code: Select all | Expand
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 nil
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Bad quality with GIF (and GDI+)
Please open the GIF with any image viewer and compare with your sample. You'll see the difference.
EMG
EMG
Re: Bad quality with GIF (and GDI+)
Enrico ,I do not find significant differences.
Paste a screenshot with 4 images. top-left gdi+ , bottom-left freeimage , top-right pixelformer and bottom-right viewer macOsx.

Paste a screenshot with 4 images. top-left gdi+ , bottom-left freeimage , top-right pixelformer and bottom-right viewer macOsx.

- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Bad quality with GIF (and GDI+)
Too small to see any differences. Anyway, try to send me your EXE to test it here.
EMG
EMG
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Bad quality with GIF (and GDI+)
Your EXE seems to work fine! Can I have the source code, please? The one that you gave me is different.
EMG
EMG
Re: Bad quality with GIF (and GDI+)
Enrico , code here :https://www.dropbox.com/s/tpbv93i3gxv187y/gdiplus4.prg?dl=0
with emf fines work fine also.
with emf fines work fine also.
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Bad quality with GIF (and GDI+)
Ok, it doesn't work fine here. So you are not using the official FWH build 4 from Fivetech website, right?
EMG
EMG
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Bad quality with GIF (and GDI+)
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.
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.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Bad quality with GIF (and GDI+)
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

EMG
Re: Bad quality with GIF (and GDI+)
enrico , please send your exe file to compare here. I use harbour , bcc7 and fwh 15.09 build4 also. ¿? 
