Recent

Author Topic: GDI plus in Lazarus?  (Read 11254 times)

Peiman

  • New Member
  • *
  • Posts: 41
GDI plus in Lazarus?
« on: March 07, 2009, 09:52:53 am »
Hi!

Normally, only .NET compilers can use GDI+ packages. But there is some units that allow Win32 applications use it as well. I used one of them successfully in Delphi. In lazarus, by contrast, I can't use them since they give me plenty of errors.

Some of the errors are based on redifned or undefined type which are easily resolvable. But some other are more complicated, for example, it seems Delphi allows the user to import functions without their complete definition from a DLL while Lazarus doesn't.

Is there any way to use GDI+ in Lazarus?


Sternas Stefanos

  • Full Member
  • ***
  • Posts: 170
  • Ex Pilot, M.Sc, Ph.D
    • http://www.pilotlogic.com
Re: GDI plus in Lazarus?
« Reply #1 on: March 07, 2009, 06:18:27 pm »
Try this

http://www.pilotlogic.com/files/pl_Win_DGIplus.zip

This is our first Version for Windows 32/64 bit
of GDI+ Library.

This is part of CodeTyphon Project
http://www.pilotlogic.com/

Please post code updates...
CodeTyphon Architect and Programmer

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: GDI plus in Lazarus?
« Reply #2 on: March 10, 2009, 03:50:38 am »
Quote
Delphi allows the user to import functions without their complete definition from a DLL while Lazarus doesn't
Example please...? Have you consulted the docs?

Peiman

  • New Member
  • *
  • Posts: 41
Re: GDI plus in Lazarus?
« Reply #3 on: March 10, 2009, 07:19:14 am »
I didn't mean that there is no function definition at all. the definition and importing are not within the same line. At first it is defined as "stdcall" then imported from DLL. :


function GdipAlloc(size: ULONG): Pointer; stdcall;

implementation

const
  gdipluslib = 'gdiplus.dll';

function GdipAlloc; external gdipluslib;


It works in Delphi, but not in Lazarus ( even with delphi option compiler). Maybe a certain compiler directive is needed.

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
Re: GDI plus in Lazarus?
« Reply #4 on: March 10, 2009, 10:16:00 am »
try so:
Code: [Select]
interface
...
const
  gdipluslib = 'gdiplus.dll';

function GdipAlloc(size: ULONG): Pointer; stdcall; external gdipluslib;

implementation

// nothing here

Peiman

  • New Member
  • *
  • Posts: 41
Re: GDI plus in Lazarus?
« Reply #5 on: March 10, 2009, 08:23:16 pm »
Thanks,
Good advice! Bu there are more than 100 functions! I will write a program to do it for me.


 

TinyPortal © 2005-2018