FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GdiPlus
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
GdiPlus
Posted: Tue Aug 20, 2024 01: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 253
Joined: Wed May 25, 2016 01:04 AM
Re: GdiPlus
Posted: Tue Aug 20, 2024 05: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.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: GdiPlus
Posted: Tue Aug 20, 2024 05:22 PM

Dear Michel,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: GdiPlus
Posted: Tue Aug 20, 2024 05:28 PM

Antonio,

Fantastic.

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: GdiPlus
Posted: Tue Aug 20, 2024 05: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: GdiPlus
Posted: Tue Aug 20, 2024 06: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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: GdiPlus
Posted: Tue Aug 20, 2024 06: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: GdiPlus
Posted: Tue Aug 20, 2024 08: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
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: GdiPlus
Posted: Wed Aug 21, 2024 01: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: GdiPlus
Posted: Fri Aug 23, 2024 12:35 PM

No news yet?

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: GdiPlus
Posted: Fri Aug 23, 2024 06:27 PM
Enlarging an image.
Code (fw): Select all Collapse
aImage := FW_ReadImage( nil, cOriginalFile, { nNewWidth, nNewHeight }, .t. )
FW_SaveImage( aImage[ 1 ], "zoomed.png" )
PalBmpFree( aImage )
Regards



G. N. Rao.

Hyderabad, India
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: GdiPlus
Posted: Fri Aug 23, 2024 09: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: GdiPlus
Posted: Sat Aug 24, 2024 05:46 PM
Please copy this program to your fwh\samples folder and try building with buildh.bat and buildxhb.bat
Code (fw): Select all Collapse
#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

Continue the discussion