Binary Type copyImage Method (NFS 65926)

The Binary primitive type now provides the copyImage method, which has the following signature.

copyImage(left:   Integer; 
          top:    Integer; 
          width:  Integer; 
          height: Integer): Binary;

This method enables you to create a new image (a rectangle subset) from the specified part of an existing binary image of the receiver. The created image has the same type as the original image from which it was created (that is, a .bmp, .tiff, .gif, .png, or .jpeg image).

In addition, the created image has the same bit and color depth as the original image (for example, 24‑bit, 8‑bit, and so on). If the image is 32‑bit, the alpha channel (transparency) information is preserved for each pixel description that is copied.

The copyImage method generates an exception if the: