Page 1 of 1
GdiPlus
Posted: Tue Aug 20, 2024 1:31 pm
by driessen
Hello,
I need two files:
- gdiplus.ch
- gdiplus.lib
I want to use to use GdiPlus in my FWH-application to enlarge pictures.
Thanks.
Re: GdiPlus
Posted: Tue Aug 20, 2024 5:05 pm
by wartiaga
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.
gdiplus.lib It's in the BCC PSDK folder.
Re: GdiPlus
Posted: Tue Aug 20, 2024 5:22 pm
by Antonio Linares
Dear Michel,
We are going to help you. Please wait for our answer, thanks
Re: GdiPlus
Posted: Tue Aug 20, 2024 5:28 pm
by driessen
Antonio,
Fantastic.
Thanks.
Re: GdiPlus
Posted: Tue Aug 20, 2024 5:39 pm
by driessen
Antonio,
FYI
I found a GDIPLUS.LIB in de library of xHarbour Professional. It has a date in 2015.
Can it be used?
Re: GdiPlus
Posted: Tue Aug 20, 2024 6:02 pm
by nageswaragunupudi
Are you using xHarbour professional?
If you are using normal xHarbour or Harbour, GDI+ functionality is already built-in to FWH
Please let me know clearly your xHarbour/Harbour version and your requirement.
Re: GdiPlus
Posted: Tue Aug 20, 2024 6:29 pm
by driessen
Mr. Rao,
I only use xHarbour Professional for debugging reasons.
For the versions which I give to my customers, I always use Harbour.
And for Harbour, these files are needed.
Re: GdiPlus
Posted: Tue Aug 20, 2024 8:07 pm
by nageswaragunupudi
You must be already linking \harbour\lib\psdk\gdiplus.lib.
Without linking you can not link any harbour application.
All your applications are already using GDI+ , but you may not be aware of it.
You do not need to do anything extra now.
Just try ximage02.prg and ximage01.prg in samples folder.
By rotating mousewheel you can zoom and unzoom the images.
Please let us know your exact requirement and we will suggest appropriate functions.
Re: GdiPlus
Posted: Wed Aug 21, 2024 1:09 pm
by driessen
Mr. Rao,
Using a combination of FWH and macros in Word, I turn each page into a PNG file which is saved on my disk. Then I start a blank Word document, then these PNG-files are opened one by one, after which they are pasted in the blank Word document.
Then a new Outlook message is created, the PNG-files in the Word document are copied to the Outlook message.
The result is that the correspondent can read the text immediately instead of having to open another attachment.
I establised all this in FWH and it really works very well.
I only need to paste the PNG-files into a bigger format.
And I'm looking for a solution to realize that.
Thank you.
Re: GdiPlus
Posted: Fri Aug 23, 2024 12:35 pm
by driessen
No news yet?
Re: GdiPlus
Posted: Fri Aug 23, 2024 6:27 pm
by nageswaragunupudi
Enlarging an image.
Code: Select all | Expand
aImage := FW_ReadImage( nil, cOriginalFile, { nNewWidth, nNewHeight }, .t. )
FW_SaveImage( aImage[ 1 ], "zoomed.png" )
PalBmpFree( aImage )
Re: GdiPlus
Posted: Fri Aug 23, 2024 9:11 pm
by driessen
Mr. Rao,
THanks a lot for your suggestion.
After line 2 I got an error : "Invalid image".
Another problem: in the first line there are nNewHeight and nNewWitdth.
But I need to know the height and width of the original image first.
Then I have to calculate the new value by adding a percentage.
How can I establish that?
Thanks
Re: GdiPlus
Posted: Sat Aug 24, 2024 5:46 pm
by nageswaragunupudi
Please copy this program to your fwh\samples folder and try building with buildh.bat and buildxhb.bat
Code: Select all | Expand
#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