iRateW = ( DOUBLE ) iNewWidth / ( DOUBLE ) bm.bmWidth * 100 + 1;
iRateH = ( DOUBLE ) iNewHeight / ( DOUBLE ) bm.bmHeight * 100 + 1;
iRateW = ( DOUBLE ) iNewWidth / ( DOUBLE ) bm.bmWidth * 100;
iRateH = ( DOUBLE ) iNewHeight / ( DOUBLE ) bm.bmHeight * 100;
iRateW = ( DOUBLE ) iNewWidth / ( DOUBLE ) bm.bmWidth * 100 + 0.9;
iRateH = ( DOUBLE ) iNewHeight / ( DOUBLE ) bm.bmHeight * 100 + 0.9;
#include "Fivewin.ch"
FUNCTION MAIN()
TEST( .T. )
TEST( .F. )
RETURN NIL
STATIC FUNCTION TEST( lImg )
LOCAL oDlg
DEFINE DIALOG oDlg;
STYLE NOR( WS_POPUP, WS_DLGFRAME, DS_MODALFRAME );
SIZE 800, 600
ACTIVATE DIALOG oDlg;
ON PAINT DRAWIMG( "c:\fwh\bitmaps\magic.bmp", hDC, oDlg:nWidth, oDlg:nHeight, lImg );
CENTER
RETURN NIL
STATIC FUNCTION DRAWIMG( cFile, hDC, nWidth, nHeight, lImg )
LOCAL hImg := LOADIMG( cFile )
LOCAL hImg2
IF lImg
hImg2 = RESIZEIMG( hImg, nWidth, nHeight )
ELSE
hImg2 = RESIZEBMP( hImg, nWidth, nHeight )
ENDIF
ABPAINT( hDC, 0, 0, hImg2, 255 )
DELETEOBJECT( hImg2 )
DELETEOBJECT( hImg )
RETURN NIL
STATIC FUNCTION LOADIMG( cFile )
IF !FILE( cFile )
RETURN 0
ENDIF
RETURN GDIP_IMAGEFROMFILE( cFile, .T. )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 10 guests