Bad quality with GIF (and GDI+)

Re: Bad quality with GIF (and GDI+)

Postby Enrico Maria Giordano » Sun Nov 01, 2015 12:02 pm

And we need a solution for loading GIF too.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bad quality with GIF (and GDI+)

Postby mastintin » Sun Nov 01, 2015 12:19 pm

when they loaded look good right?
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Bad quality with GIF (and GDI+)

Postby Enrico Maria Giordano » Sun Nov 01, 2015 12:59 pm

No. As I already wrote, with FILoadImage() the GIFs look fine while with GDIP_LOADFROMFILE() don't.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bad quality with GIF (and GDI+)

Postby mastintin » Sun Nov 01, 2015 6:00 pm

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
Code: Select all  Expand view  RUN

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

 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Bad quality with GIF (and GDI+)

Postby Enrico Maria Giordano » Sun Nov 01, 2015 6:25 pm

Please open the GIF with any image viewer and compare with your sample. You'll see the difference.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bad quality with GIF (and GDI+)

Postby mastintin » Mon Nov 02, 2015 7:49 am

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.
Image
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Bad quality with GIF (and GDI+)

Postby Enrico Maria Giordano » Mon Nov 02, 2015 8:51 am

Too small to see any differences. Anyway, try to send me your EXE to test it here.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bad quality with GIF (and GDI+)

Postby mastintin » Mon Nov 02, 2015 10:03 am

the program :
for jpg,gif,tif,bmp,ico files
https://www.dropbox.com/s/sr2lij7jughmh ... 4.rar?dl=0
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Bad quality with GIF (and GDI+)

Postby Enrico Maria Giordano » Mon Nov 02, 2015 10:19 am

Your EXE seems to work fine! Can I have the source code, please? The one that you gave me is different.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bad quality with GIF (and GDI+)

Postby mastintin » Mon Nov 02, 2015 10:47 am

Enrico , code here :https://www.dropbox.com/s/tpbv93i3gxv187y/gdiplus4.prg?dl=0
with emf fines work fine also.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Bad quality with GIF (and GDI+)

Postby Enrico Maria Giordano » Mon Nov 02, 2015 10:53 am

Ok, it doesn't work fine here. So you are not using the official FWH build 4 from Fivetech website, right?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bad quality with GIF (and GDI+)

Postby nageswaragunupudi » Mon Nov 02, 2015 11:26 am

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Bad quality with GIF (and GDI+)

Postby mastintin » Mon Nov 02, 2015 11:36 am

Enrico , All code uses the official version fwh build 4 .
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Bad quality with GIF (and GDI+)

Postby Enrico Maria Giordano » Mon Nov 02, 2015 11:41 am

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
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bad quality with GIF (and GDI+)

Postby mastintin » Mon Nov 02, 2015 11:45 am

enrico , please send your exe file to compare here. I use harbour , bcc7 and fwh 15.09 build4 also. ¿? :-(
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 49 guests

cron