Image Class

Provides methods for loading, saving, and manipulating images. If you want to manipulate several images at the same time, use the Imagelist Class.

You can construct Image objects from the following file types:

  • Raster (bitmap) formats - .bmp, .gif, .jpg, .png, .tiff, and .exif

  • Vector formats - .emf and .wmf

NoteNote

In Microsoft Dynamics AX, the Image class is bound to the client. The class can no longer be run from the server because of the security risks that are associated with file handling.



class Image extends BinData

Client

Method

Description

appendData

(Inherited from BinData.)

appendToFile

(Inherited from BinData.)

ascii85Encode

(Inherited from BinData.)

base64Encode

(Inherited from BinData.)

cancelTimeOut

Cancels a previous method call to the Object.setTimeOut Method. (Inherited from Object.)

captureScreen

Captures an image from the screen by using the coordinates that are supplied in the parameter list.

captureWindow

Captures a window as an image, using the handle that is supplied as a parameter. 

clipboardCopy

Copies an image to the clipboard.

clipboardPaste

Overwrites an existing image with the content of the system clipboard.

compressLZ77

(Inherited from BinData.)

copyData

(Inherited from BinData.)

copyImage

Copies the current image object. 

createImage

Creates an empty bitmap image with the width, height, and color depth as specified by the parameters.

crop

Crops the image. 

decompressLZ77

(Inherited from BinData.)

displayImage

Draws an image with the device context specified by the HDC parameter.

displayOrign

Enables you to specify an offset (X, Y) from the original origin (0, 0).

equal

Determines whether the specified object is equal to the current one. (Inherited from Object.)

exportBitmap

Gets a handle for the image.

finalize

Overridden.

flip

Rotates the image 180 degrees in a vertical or horizontal direction. 

getAsciiData

(Inherited from BinData.)

getData

(Inherited from BinData.)

getPixel

Retrieves the ARGB color value of the pixel at the point that is specified by the parameters. 

getStrData

(Inherited from BinData.)

getTimeOutTimerHandle

Returns the timer handle for the object. (Inherited from Object.)

getVariant

(Inherited from BinData.)

handle

Retrieves the handle of the class of the object. (Inherited from Object.)

height

Retrieves the height of the image in pixels.

imageInfo

Retrieves the width, height, and color depth (number of bits per pixel) of the image.

imageSpotlight

Produces a "spotlight" effect within the circle that is defined by radius with center coordinates x and y. The pixels within the circle are unchanged, but the other pixels in the image are darkened by reducing their intensity.

importBitmap

Clones a bitmap from the image that is specified by the hBitmap parameter.

importFileIcon

Creates an icon from the file specified by the fileName parameter by copying the icon that is used for the file.

importIcon

Retrieves a handle to an icon from an executable file in Microsoft Dynamics AX. The icon is specified by the fileName and iconIdx parameters.

loadFile

(Inherited from BinData.)

loadImage

Loads an image from the file specified by the fileName parameter.

loadResource

Loads a resource from Ax32.exe.

new

Overridden. Creates a new image. You do not need to specify any parameters, but it is possible to specify the image contents and size.

notify

Releases the hold on an object that has called a wait method on this object. (Inherited from Object.)

notifyAll

Releases a lock on the object that was issued by a wait method on this object. (Inherited from Object.)

objectOnServer

Determines whether the object is on a server. (Inherited from Object.)

owner

Returns the instance that owns the object. (Inherited from Object.)

promoteColor

Increases the color depth of the image.

reduceColorOctree

Reduces the color depth of an image. The method reduces a 24-bit image to 8 bits, or an 8-bit image to 4 bits, unless other instructions are specified in the maxColors parameter.

removeImage

Removes the data about an image; the object still exists, but has no data.

resize

Resizes the image to the size that is specified by newWidth and newHeight parameters. The InterpolationMode parameter determines the resizing method.

rotate

Rotates the image. The amount of rotation is specified by the RotateType parameter.

saveFile

(Inherited from BinData.)

saveImage

Saves the image to the specified file name.

saveType

Gets or sets the image decoder.

setAsciiData

(Inherited from BinData.)

setBinaryData

(Inherited from BinData.)

setData

(Inherited from BinData.)

setPixel

Sets the color for the pixel that is specified by the x and y parameters.

setStrData

(Inherited from BinData.)

setTimeOut

Sets up the scheduled execution of a specified method. (Inherited from Object.)

setVariant

(Inherited from BinData.)

size

(Inherited from BinData.)

toString

Returns a string that represents the current object. (Inherited from Object.)

transparent

Sets the transparent color for the image. If any of the input parameters are missing, the color at the point (0,0) in the image is used. If you want to specify a color, this is expressed as an RGB color by using parameters 2 to 4.

usageCount

Returns the current number of references (the value of the reference counter) that the object has. (Inherited from Object.)

wait

Pauses a process. (Inherited from Object.)

width

Retrieves the width of the image in pixels.

xml

Returns an XML string that represents the current object. (Inherited from Object.)

::canLoad

Checks whether an image file exists and can be opened. 

::loadExt

Retrieves a list of the extensions of the file formats that are supported by the Image class.

::resourceType

Determines whether a particular resource is a bitmap or an icon.

::rgb

Converts an RGB value to an ARGB value.

::validResource

Checks whether the resource specified by the id parameter is valid.

The following example prints the height of Picture.jpg in pixels.

Image img = new  Image();
;
 
img.loadFile(@'C:\MyPictures\Picture.jpg');
print img.height();
pause;

Community Additions

ADD
Show: