Hello,
I need two files:
- gdiplus.ch
- gdiplus.lib
I want to use to use GdiPlus in my FWH-application to enlarge pictures.
Thanks.
driessen wrote:Hello,
I need two files:
- gdiplus.ch
- gdiplus.lib
I want to use to use GdiPlus in my FWH-application to enlarge pictures.
Thanks.
aImage := FW_ReadImage( nil, cOriginalFile, { nNewWidth, nNewHeight }, .t. )
FW_SaveImage( aImage[ 1 ], "zoomed.png" )
PalBmpFree( aImage )
#include "fivewin.ch"
function Main()
local cImage := "..\bitmaps\olga1.jpg"
local cZoom := "..\bitmaps\zoom.png"
if ISXHBCOM()
if FreeImageIsLoaded()
ZoomImageXHB( cImage, cZoom )
else
? "FreeImage.DLL required"
endif
else
ZoomImageFWH( cImage, cZoom )
endif
return nil
function ZoomImageFWH( cImage, cZoom )
local aImage, nWidth, nHeight
if File( cImage )
if File( cZoom ) .and. FErase( cZoom ) != 0
? cZoom + " exists and can not be overwritten"
return nil
endif
aImage := FW_ReadImage( nil, cImage )
nWidth := aImage[ 3 ]
nHeight := aImage[ 4 ]
PalBmpFree( aImage )
//
aImage := FW_ReadImage( nil, cImage, { nWidth * 2, nHeight * 2 }, .f. )
FW_SaveImage( aImage[ 1 ], cZoom )
//
XImage( cZoom )
else
? cImage + " not found"
endif
return nil
function ZoomImageXHB( cImage, cZoom )
local hBmp, hZoom, nFormat, nWidth, nHeight
if File( cImage )
if File( cZoom ) .and. FErase( cZoom ) != 0
? cZoom + " exists and can not be overwritten"
return nil
endif
hBmp := FILoadImg( cImage )
nWidth := nBmpWidth( hBmp )
nHeight := nBmpHeight( hBmp )
hZoom := ResizeImg( hBmp, nWidth * 2, nHeight * 2 )
DeleteObject( hBmp )
FW_SaveHBitmap( hZoom, "tmp.bmp" )
DeleteObject( hZoom )
nFormat := FI_GetFileTypeFromFileName( "png" )
FIConvertImageFile( "tmp.bmp", cZoom, nFormat, 0 )
FErase( "tmp.bmp" )
//
ximage( FILoadImg( cZoom ), cZoom )
else
? cImage + " not found"
endif
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 105 guests