GdiPlus

GdiPlus

Postby driessen » Tue Aug 20, 2024 1:31 pm

Hello,

I need two files:

- gdiplus.ch
- gdiplus.lib

I want to use to use GdiPlus in my FWH-application to enlarge pictures.

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GdiPlus

Postby wartiaga » Tue Aug 20, 2024 5:05 pm

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.
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: GdiPlus

Postby Antonio Linares » Tue Aug 20, 2024 5:22 pm

Dear Michel,

We are going to help you. Please wait for our answer, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: GdiPlus

Postby driessen » Tue Aug 20, 2024 5:28 pm

Antonio,

Fantastic.

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GdiPlus

Postby driessen » Tue Aug 20, 2024 5:39 pm

Antonio,

FYI

I found a GDIPLUS.LIB in de library of xHarbour Professional. It has a date in 2015.
Can it be used?
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GdiPlus

Postby nageswaragunupudi » Tue Aug 20, 2024 6:02 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GdiPlus

Postby driessen » Tue Aug 20, 2024 6:29 pm

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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GdiPlus

Postby nageswaragunupudi » Tue Aug 20, 2024 8:07 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GdiPlus

Postby driessen » Wed Aug 21, 2024 1:09 pm

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.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GdiPlus

Postby driessen » Fri Aug 23, 2024 12:35 pm

No news yet?
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GdiPlus

Postby nageswaragunupudi » Fri Aug 23, 2024 6:27 pm

Enlarging an image.
Code: Select all  Expand view  RUN
aImage := FW_ReadImage( nil, cOriginalFile, { nNewWidth, nNewHeight }, .t. )
FW_SaveImage( aImage[ 1 ], "zoomed.png" )
PalBmpFree( aImage )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GdiPlus

Postby driessen » Fri Aug 23, 2024 9:11 pm

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
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: GdiPlus

Postby nageswaragunupudi » Sat Aug 24, 2024 5:46 pm

Please copy this program to your fwh\samples folder and try building with buildh.bat and buildxhb.bat
Code: Select all  Expand view  RUN
#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
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests