Page 1 of 1

.NET Woes

Posted: Fri Jul 15, 2011 12:51 am
by Kevin
Hi All,

Has anyone successfully used the JadeDotNetType::getPicture method?
Invoking this method using the example provided (shown below) on Jade 6.3.08 produces a ".NET object already created" exception.

I'd also like to know if a static method on a .NET class can be invoked without creating the .NET object. System.Drawing.Graphics provides static methods to create a Graphics instance (i.e. FromImage), however it seems you cannot create an instance in the first place in Jade to call the method. Catch 22.

Cheers,
Kevin

vars
i : JadeDotNetType; // To represent an Image object
begin
// Use createPicture to make an Image object
create i transient;
i.createPicture(app.loadPicture("c:\jade.bmp"));
// Use the helper method to retrieve binary picture information
write i.getPicture.pictureType; // Outputs 1 (PictureType_Bitmap)
epilog
delete i;
end;

Re: .NET Woes

Posted: Fri Jul 15, 2011 7:51 am
by BeeJay
We've not specifically used the getPicture method, in our case we needed to put the generated picture into an imageList as per the following partial section of our code.

Code: Select all

vars imgList : SWFImageList ; workerImage : JadeDotNetType ; diagramImage : Binary ; begin diagramImage := pEntity.getDiagramImage(); create workerImage transient ; workerImage.createPicture( diagramImage ); create imgList transient ; imgList.images.add_Icon( workerImage );
ie: Once we've called the createPicture, we then use that JadeDotNetType workerImage instance as though it was an image.

Depending on what you're wanting to achieve with the picture after you've created it, you may be able to do something similar:

Cheers,
BeeJay.