*** 20,25 ****
--- 20,26 ----
CLASS TImage FROM TBitmap
DATA nProgress
+ DATA hDib
CLASSDATA lRegistered AS LOGICAL
***************
*** 35,40 ****
--- 36,43 ----
METHOD Progress( lProgress )
METHOD LoadFromMemory( cBuffer )
+
+ METHOD HasAlpha() INLINE FIISTRANSPARENT( ::hDib )
ENDCLASS
***************
*** 79,85 ****
if ! Empty( cBmpFile ) .and. File( cBmpFile )
::cBmpFile = cBmpFile
! ::hBitmap = FILoadImg( AllTrim( cBmpFile ) )
endif
if ::hBitmap != 0
--- 82,88 ----
if ! Empty( cBmpFile ) .and. File( cBmpFile )
::cBmpFile = cBmpFile
! ::hBitmap = FILoadImg( AllTrim( cBmpFile ), Self )
endif
if ::hBitmap != 0
***************
*** 106,112 ****
lChanged = .t.
cBmpFile = nil
elseif File( cBmpFile )
! ::hBitmap = FILoadImg( AllTrim( cBmpFile ) )
lChanged := .t.
cResName := nil
endif
--- 109,115 ----
lChanged = .t.
cBmpFile = nil
elseif File( cBmpFile )
! ::hBitmap = FILoadImg( AllTrim( cBmpFile ), Self )
lChanged := .t.
cResName := nil
endif
***************
*** 183,193 ****
#define CBM_INIT 4
#define DIB_RGB_COLORS 0
! static function FILOADIMG( cFile )
local nFormat, hDib, hInfoH, hInfo, hBits, hWnd, hDC, hBmp
if Upper( cFileExt( cFile ) ) = "BMP"
return ReadBitmap( 0, cFile )
endif
--- 186,198 ----
#define CBM_INIT 4
#define DIB_RGB_COLORS 0
! static function FILOADIMG( cFile, oImage )
local nFormat, hDib, hInfoH, hInfo, hBits, hWnd, hDC, hBmp
if Upper( cFileExt( cFile ) ) = "BMP"
+ nFormat = FIGETFILETYPE( cFile, 0 )
+ oImage:hDib = FILOAD( nFormat, cFile, 0 )
return ReadBitmap( 0, cFile )
endif
***************
*** 203,209 ****
endif
nFormat = FIGETFILETYPE( cFile, 0 )
! hDib = FILOAD( nFormat, cFile, 0 )
hInfoH = FIGETINFOHEADER( hDib )
hInfo = FIGETINFO( hDib )
hBits = FIGETBITS( hDib )
--- 208,214 ----
endif
nFormat = FIGETFILETYPE( cFile, 0 )
! oImage:hDib = FILOAD( nFormat, cFile, 0 )
hInfoH = FIGETINFOHEADER( hDib )
hInfo = FIGETINFO( hDib )
hBits = FIGETBITS( hDib )
***************
*** 212,218 ****
#ifdef __CLIPPER__
hDC = GETDC32( hWnd )
#else
! hDC = GETDC( hWnd )
#endif
hBmp = CreateDiBitmap( hDC, hInfoH, CBM_INIT, hBits, hInfo, DIB_RGB_COLORS )
--- 217,223 ----
#ifdef __CLIPPER__
hDC = GETDC32( hWnd )
#else
! hDC = GETDC( hWnd )
#endif
hBmp = CreateDiBitmap( hDC, hInfoH, CBM_INIT, hBits, hInfo, DIB_RGB_COLORS )
***************
*** 381,396 ****
DLL32 FUNCTION WOWHANDLE16( nHandle AS LONG, nHandleType AS LONG ) AS LONG ;
PASCAL FROM "WOWHandle16" LIB "wow32.dll"
! DLL32 STATIC FUNCTION FI_OpenMemory( cData AS LPSTR, nSize AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_OpenMemory@8" LIB hLib
! DLL32 STATIC FUNCTION FI_LoadFromMemory( nFormat AS LONG, nStream AS LONG, nFlags AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_LoadFromMemory@12" LIB hLib
! DLL32 STATIC FUNCTION FI_CloseMemory( nStream AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_CloseMemory@4" LIB hLib
! DLL32 STATIC FUNCTION FI_GetFileTypeFromMemory( nStream AS LONG, nSize AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_GetFileTypeFromMemory@8" LIB hLib
!
//----------------------------------------------------------------------------//
--- 386,401 ----
DLL32 FUNCTION WOWHANDLE16( nHandle AS LONG, nHandleType AS LONG ) AS LONG ;
PASCAL FROM "WOWHandle16" LIB "wow32.dll"
! DLL32 FUNCTION FI_OpenMemory( cData AS LPSTR, nSize AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_OpenMemory@8" LIB hLib
! DLL32 FUNCTION FI_LoadFromMemory( nFormat AS LONG, nStream AS LONG, nFlags AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_LoadFromMemory@12" LIB hLib
! DLL32 FUNCTION FI_CloseMemory( nStream AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_CloseMemory@4" LIB hLib
! DLL32 FUNCTION FI_GetFileTypeFromMemory( nStream AS LONG, nSize AS LONG ) AS LONG ;
PASCAL FROM "_FreeImage_GetFileTypeFromMemory@8" LIB hLib
!
//----------------------------------------------------------------------------//