Page 6 of 6

Re: Bad quality with GIF (and GDI+)

PostPosted: Wed Nov 04, 2015 8:54 pm
by nageswaragunupudi
Enrico Maria Giordano wrote:Probably I'm doing something wrong but it doesn't work (GIFs are still bad rendered).

EMG

With what control are you testing?

Re: Bad quality with GIF (and GDI+)

PostPosted: Wed Nov 04, 2015 9:06 pm
by Enrico Maria Giordano
Just loading with GDIP_IMAGEFROMFILE().

EMG

Re: Bad quality with GIF (and GDI+)

PostPosted: Wed Nov 04, 2015 9:21 pm
by nageswaragunupudi
Just sent you revised libs.

Re: Bad quality with GIF (and GDI+)

PostPosted: Wed Nov 04, 2015 9:47 pm
by Enrico Maria Giordano
Received and already reported back.

EMG

Re: Bad quality with GIF (and GDI+)

PostPosted: Wed Nov 04, 2015 9:50 pm
by nageswaragunupudi
Please try:
Code: Select all  Expand view
function testgif()

   local cFile    := "c:\fwh\gifs\magic10.gif"
   local hBmp, oWnd

   hBmp     := GDIP_IMAGEFROMFILE( cFile, .t. )

   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd CENTERED ON PAINT oWnd:SayPalBmp( hBmp )

   DeleteObject( hBmp )

return nil
 

Re: Bad quality with GIF (and GDI+)

PostPosted: Wed Nov 04, 2015 10:02 pm
by Enrico Maria Giordano
I was not clear enough. The misalignment is between ResizeImg() and ResizeBmp().

EMG

Re: Bad quality with GIF (and GDI+)

PostPosted: Wed Nov 04, 2015 10:31 pm
by nageswaragunupudi
I hope the quality issue is now resolved.

In any case, FWH libs are no more using ResizeImg or ResizeBmp for rendering resized images, except for Gray images. Whether both methods differ by a pixel or not now remains an academic issue. With your help, we now added resize width, height as 6,7th params to ABPaint()

Secondly, for bmp files FWH is using classic GDI but not GDI+. So for magic.bmp the FWH is using PalBmpRead() / ReadBmp()
oWnd:ReadPalBmpEx( uSource ) -> aBmpPal reads the image using the appropriate functions.
oWnd:SayPalBmp( aBmpPal/hBitmap, [aRect (default ClientRect)], [lTransparent (default .t. )], [lStretch/nResizeMode], [nAlpha/lAlpha],[lGray] )
paints the image using the appropriate painting function eg. ABPaint(), TransBmp(),PalBmpDraw()

For the sample you sent me, I suggest using FWH methods like this:
Code: Select all  Expand view
function magicbmp()

   local oDlg, aBmp
   local cFile := "c:\fwh\bitmaps\magic.bmp"

   DEFINE DIALOG oDlg SIZE 800,600 PIXEL

   aBmp  := oDlg:ReadPalBmpEx( cFile )

   ACTIVATE DIALOG oDlg ON PAINT ;
      oDlg:SayPalBmp( aBmp, ;
                      nil, ;  // Default full client Rect
                      .f., ;  // transparency
                      .t. )   // Stretch full ( .f. or nil -> centers image )

return nil
 

Re: Bad quality with GIF (and GDI+)

PostPosted: Thu Nov 05, 2015 9:57 am
by Enrico Maria Giordano
Rao,

ok for the quality issue. But saving to GIF still give bad result:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL cSrcImage := "c:\fwh\bitmaps\magic.bmp"
    LOCAL cDstImage := "magic.gif"

    LOCAL oGdi := GDIBmp():New( cSrcImage )

    oGdi:Save( cDstImage )

    oGdi:End()

    RETURN NIL


EMG

Re: Bad quality with GIF (and GDI+)

PostPosted: Thu Nov 05, 2015 9:58 am
by Enrico Maria Giordano
Rao,

you showed us your face, at last! :-D

EMG

Re: Bad quality with GIF (and GDI+)

PostPosted: Fri Nov 06, 2015 3:41 pm
by Enrico Maria Giordano
Enrico Maria Giordano wrote:Rao,

ok for the quality issue. But saving to GIF still give bad result:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL cSrcImage := "c:\fwh\bitmaps\magic.bmp"
    LOCAL cDstImage := "magic.gif"

    LOCAL oGdi := GDIBmp():New( cSrcImage )

    oGdi:Save( cDstImage )

    oGdi:End()

    RETURN NIL


EMG


Any news? :-)

EMG