• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

DelphiXE3 VC++ Lazarus Dll

Started by sikale, 9 November 2012, 15:55:08

Previous topic - Next topic

sikale

Lazarus1.0.2 Compiled  "VampyreImaging.lpi"
Generate "VampyreImaging.dll"

VC++ Run "test.c"
........................
/* save image to Targa format */
ImSaveImageToFile("ctestimage.png", &Img);  //Unable to generate images
DelphiXE3 Call VampyreImaging.dll //Unable to generate images too

but VampyreImaging.dll of DelphiXE3  Generated
generate images is OK.

How do I set Lazarus?

Sorry, my English is poor。  :-[

sikale

Delphi create Image: TImageData;
ImNewImage(256, 256, ifA8R8G8B8, Image);

Passed to Lazarus
Run " TestImage(Image) "

Result is:
LongInt(Image.Width)  1242488        // Should be 256
LongInt(Image.Height)  1243380       //Should be 256
LongInt(Image.Format)  6244311      // Should be 88

Google to Similar problems:
http://community.freepascal.org:10000/bboards/message?message_id=335641&forum_id=24082

sikale

10 November 2012, 06:56:09 #2 Last Edit: 10 November 2012, 07:26:39 by sikale
function ImSaveImageToFile(FileName: PAnsiChar; const Image: TImageData): Boolean; cdecl;

Modified to

function ImSaveImageToFile(FileName: PAnsiChar; const Image: PImageData): Boolean; cdecl;
or
function ImSaveImageToFile(FileName: PAnsiChar; var Image: TImageData): Boolean; cdecl;

Delphi Pass a  PImageData pointer to Lazarus
or
var Image

run  is OK  ;D

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk