testing the Zoom-function of the Image-viewer I noticed :
All Images < BMP with Alphachannel, PNG > it is possible to Zoom with adjusted Dialog to Imagesize.
Maybe I have to use a different Solution for NON transparent Images.
I remember, that it is possible to detect a Alpha-channel from a Image.
Tested, but with wrong Return-Values ( Icons return .F. ) JPG's are OK.
DEFINE IMAGE oImage FILE cImgname
msgalert( HasAlpha( oImage:hBitmap ) )
Case32.bmp doesn't have a Alpha-channel, only a Backgroundcolor. I think the Reason, that returns .F.
@ 0, 0 IMAGE oImage FILE cImgname SIZE nWidth, nHeight NOBORDER PIXEL
oImage:lTransparent := .T.
oImage:Zoom( nZoom )
impossible, to Zoom a NON transparent Image (ignored ).
Added Alphachannel to a < normal BMP > it works.
In Class Bitmap, maybe something is missing ?
- Code: Select all Expand view
...
...
if ::nZoom > 0
if SetAlpha() .and. ::lHasAlpha
hBitmap := resizebmp( ::hBitmap, ::nWidth, ::nHeight )
ABPaint( ::hDC, ::nX, ::nY, hBitmap, ::nAlphaLevel() )
else
if ! ::lTransparent
PalBmpDraw( ::hDC, ::nX, ::nY, ::hBitmap, ::hPalette,;
::nWidth(), ::nHeight(),, ::lTransparent, ::nClrPane )
else
hBmpOld = SelectObject( ::hDC, ::hBitmap )
nZeroZeroClr = GetPixel( ::hDC, 0, 0 )
SelectObject( ::hDC, hBmpOld )
nOldClr = SetBkColor( ::hDC, nRGB( 255, 255, 255 ) )
TransBmp( ::hBitmap, ::nWidth(), ::nHeight(), nZeroZeroClr, ::hDC,;
::nY, ::nX, ::nWidth(), ::nHeight() )
SetBkColor( ::hDC, nOldClr )
endif
endif
endif
endif
...
...
Best Regards
Uwe