useImage

useImage(image: Binary);

The useImage method of the Picture class assigns an image to the picture of the picture control without creating a transient copy of that image, therefore avoiding the possibility of filling transient cache with a copy of the image, particularly for very large images. The result is the same as the picture1.picture := <binary> logic except that a copy of the image is not created in transient cache.

Calling the useImage method or assigning to the picture property discards the previous image. Both these logic statements update the same GUI object so that only the last set image is retained.

Calling the useImage method also causes the picture property to be set to null.

The following code fragment is an example of the use of this method.

vars
    bin : Binary;
begin
    bin := getImage; /* somehow retrieve the image; for example,
                        app.loadPicture */
    picture1.useImage(bin);
    /* Note that the following statement will then return 'null', even
       though the image has been set above */
    bin := picture1.picture;