.NET Woes

For questions and postings not covered by the other forums
Kevin
Posts: 29
Joined: Wed Oct 14, 2009 9:03 am
Location: Christchurch

.NET Woes

Postby Kevin » Fri Jul 15, 2011 12:51 am

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;

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: .NET Woes

Postby BeeJay » Fri Jul 15, 2011 7:51 am

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.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 19 guests

cron