Image-zoom-function : JPG / PNG different results ?

Image-zoom-function : JPG / PNG different results ?

Postby ukoenig » Tue Feb 05, 2013 12:37 am

Hello,

same used functions with different results, using PNG and JPG :
( Alphablended images are working fine : PNG and BMP )
I want to add a zoom-function-sample to the tool.
Inside the tool, I calculate the wanted image-size and resize ( no zoom is used !!! )

PNG using Zoom minus

Image

PNG using Zoom plus

Image

The same image without alphachannel with black area on Zoom + the image doesn't resize !!

Image

JPG using Zoom plus
zooms a black area, the original is still the same.

Image

JPG using Zoom minus
cuts the original with minus.factor

Image

Getting different results with this function !!!

Code: Select all  Expand view

FUNCTION ADJ_ZOOM(oBmp,cAction)
LOCAL nZoom:=oBmp:Zoom()

DO CASE
    case cAction == "S"
        oBmp:lStretch := !oBmp:lStretch
        oBmp:ScrollAdjust()
        oBmp:Refresh( .t. )
     case cAction == "R"
        if nZoom * 10 >1
            oBmp:lStretch := .f.
            nZoom:=nZoom - (0.10)
            oBmp:Zoom(nZoom)
            oBmp:Refresh()
            oBmp:ScrollAdjust()
        endif
    case cAction == "A"
        oBmp:lStretch := .f.
        nZoom:=nZoom + 0.10
        oBmp:Zoom(nZoom)
        oBmp:Refresh()
        oBmp:ScrollAdjust()
ENDCASE

RETURN NIL
 


Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 109 guests