createPicture

createPicture(entireWindow:      Boolean;
              includeChildren:   Boolean;
              numberOfColorBits: Integer): Binary;

The createPicture method of the Window and Control class creates a bitmap for the receiver form or control, respectively.

Use the entireWindow parameter to specify that the created picture includes the non-client area of the form or control, the includeChildren parameter to specify that the created picture includes child controls (that is, controls that are placed on the form or control are included in the picture), and the numberOfColorBits parameter to specify the number of color bits for the picture. (The valid numbers of color bits that you can specify are 1, 4, 8, or 24.)

The createPicture method creates an image by drawing the window (and its children, if required) and replaying any drawing commands saved while the autoRedraw property is set to true. The process does not scrape the image off the screen.

The code fragments in the following examples show the use of the createPicture method.

setBackDrop(logo.createPicture(false, true, 24), 1, -1);
// create a picture and display the common File Save dialog to list all
// available Jpeg files for picture conversion
createPicture(true, true, 24).convertToFile("", Window.PictureType_Jpeg);

When you call this method for the Window class on an MDI frame that has MDI children, the frame and all of its children are included in the image. In addition, you can use this method to capture the entire image of a Form and its controls.

The created image is a reflection of how the window, which can include child windows, would be displayed. To recreate an image of a different size, set the image into a picture control with the stretch property set to Stretch_ToControl (1) and call createPicture(false, false, 24).

The createPicture method for Picture and JadeMask Web images attempts to preserve any image transparency where possible. This applies only if all of the following are true.

If all of the above are true and the image size is:

If any of the above is false, the createPicture method constructs the required image by drawing all of the control components into a new image. This results in any transparency effects being lost.

If you rely on the value of the Picture class transparentColor property for the images, images may have a black background.

See also the Control class createPictureIndirect method, which improves JADE thin client mode performance as it does not have to pass large binary large objects (blobs) back and forth between the presentation client and the application server.