createPicture

createPicture(pic: Binary);

The createPicture method of the JadeDotNetType class is a helper method that enables you to create a .NET Image object from the System.Drawing.dll assembly if that type has not been imported into JADE; for example, if an assembly contains a class in .NET called Basic and the class has a setImage method that requires an Image object as a parameter, a Basic class with a setImage method is created when the assembly is imported into JADE. However, the Image type is not imported because it is not specific to the assembly.

The parameter to the setImage method in JADE is of the generic JadeDotNetType type.

The following method shows the use of the createPicture method.

vars
    b : Basic;                     // Subclass of JadeDotNetType
    i : JadeDotNetType;            // To represent an Image object
begin
    // Create a JADE instance of the class representing the .NET object
    create b transient;
    b.createDotNetObject;
    // Use the helper method to make an Image object
    create i transient;
    i.createPicture(app.loadPicture("c:\jade.bmp"));
    // Use the Image object as a parameter to the setImage method
    b.setImage(i);
epilog
    delete b;
    delete i;
end;