 Oracle Image Control Help Index

The Oracle Image Control displays images of different formats in an OCX container. The following

discribes the Properties and Methods of the control:

Properties

AllowEdit	BOOL

Determines whether or not the user will be allowed to make changes to the image.

AllowUndo	BOOL

Determines whether or not undoing of edit operations is required.  In-memory temporary copies of image needs to be maintained to support undo and this can be expensive for large images.  This property lets the users turn undoing support on/off depending on their requirements.  By default, this property is set to FALSE.

BorderStyle	SHORT

Returns or sets the border style for an OCX custom control. This is a stock property.

CenterImage	BOOL

Determines whether or not the image will be centered within the OCX's view.  By default the image will be displayed starting at the top left corner of the view.  If the size of the image is bigger than the view size or if the DisplayMode is set to `Fit to view', then this property is not relevant.

ClipboardFormat	SHORT

Specifies the formats in which data will be copied to the clipboard.  It can be one of DIB, Bitmap or Both.

DisplayMode	SHORT

Specifies the mode in which the image will be displayed in the OCX's view.  It can be one of Normal, Best fit, Fit to view or Use actual size.  In `Normal' display mode, one pixel of the image is mapped to one pixel in the screen.  In `Best fit' mode, the image is fit best to either the width or height of the view and the aspect ratio is also preserved.  In `Fit to view' mode, the entire image is fit into the size of the view without maintaining the aspect ratio.  In `Use actual size' mode, the displayed image has the same physical size in inches as the original image.

Dither	BOOL

Determines whether or not the image will be dithered during display.  By default the image will be dithered if it is displayed in a device that has lesser color capability than the image.

Enabled 	BOOL

Indicates whether the Image OCX is enabled. This is a stock property.

ExportCompression	BOOL

Indicates whether or not the current image should be compressed during export. Note that the value of this property is merely a request to the Image OCX; for example, if the current ExportFormat supports only compressed (or uncompressed) data, the value of this property is ignored. The default value of this property is FALSE.

ExportCompressionQuality	SHORT

When compression is available for the current ExportFormat, this property indicates the level of compression desired. The values for this property range from "Maximize Integrity" to "Maximize Compression". Note that this property is merely a request to the Image OCX; for example, if the current ExportFormat supports only lossless compression, the value of this property is ignored. The default value of this property is "Maximize Integrity".

ExportDatatype	SHORT

Identifies the datatype for a subsequent export operation (mono, grayscale, 8-bit LUT, 24-bit RGB, etc.). Note that this property is merely a request to the Image OCX; for example, if the current ExportFormat only supports 24-bit RGB, the value of this property is ignored. The default value of this property is "Automatic".

ExportFileSpec	BSTR

When this property is set to a fully qualified filename, the current image will be immediately exported. Note that the current values of ExportFormat, ExportDatatype, ExportCompression, and ExportCompressionQuality will be used during the export process.

ExportFormat	BSTR

Identifies the image format to be used for a subsequent image export operation. The default value of this property is "TIFF".

HasImage	BOOL

Determines whether or not there is a valid image associated with the image OCX.  When the OCX is first created, there is no image associated with it.  To associate an image with an image OCX, one of the import methods, Paste(), or CreateNew() must be called.

ImageCompression	BSTR (read-only)

This read-only property identifies the compression scheme of the most recently imported image.

ImageDatatype	SHORT (read-only)

This read-only property identifies the datatype (mono, grayscale, 8-bit LUT, 24-bit RGB, etc.) of the current image.

ImageFormat	BSTR (read-only)

Gets the format identifier of the current image.

ImageHeight	LONG (read-only)

Gets the height of the current image, in pixels. If there is no image, this value is zero.

ImageWidth	LONG (read-only)

Gets the width of the current image, in pixels.  If there is no image, this value is zero.

ImageXResolution	LONG (read-only)

Gets the horizontal resolution of the current image, in pixels. If there is no image, this 	value is zero.

ImageYResolution	LONG (read-only)

Gets the vertical resolution of the current image, in pixels. If there is no image, this 	value is zero.

ImportFileSpec	BSTR

When this property is set to a fully qualified filename, the referenced image will be immediately imported. The format, datatype, and compression scheme of the image will be automatically identified by the Image OCX.

IsModified	BOOL

Indicates whether the current image has been modified in any way since the most recent import operation.

Palette	SHORT

Specifies the palette to use to display the current image.  It can be one of `Image palette', `Current device palette' or `Fixed rainbow palette'.  If palette is set to `Image palette', the current image's palette will be used.  If palette is set to `Current device palette', the image will be displayed using the palette already available in the current display device.  If palette is set to `Fixed rainbow palette', a 256 color rainbow palette is used to display the image.  By default, the `Palette' property is set to `Image palette'.

Preferences	BOOL

Determines whether filter options are available to the user during image import and export.

SelectionRectangle	RECT

Specifies the rectangular area within the image that will be shown selected.  This area is clipped to the dimensions of the current image.  The selection rectangle will be used in image edit operations like cut, copy and paste.

ShowToolPalette	BOOL

Determines whether or not tool palette is displayed inside the image view.  The tool palette will have controls to do zoom, rotate, etc., with which the user can manipulate the image.  By default the tool palette is not displayed.

Visible	BOOL

Determines whether the image OCX's view box is visible or hidden.  By default the image OCX is visible.

ZoomFactor	SHORT

Specifies the percentage by which the image is zoomed up during display.  The default value for this property is 100.  Note that when the DisplayMode property is set to `Fit to view' or `Best Fit', this property is not relevant.

Methods

Copy()

Copies the selected area in the current image to the clipboard.  The format in which the data is copied is determined by the ClipboardFormat property.  If no area is selected in the current image, then the entire image is copied.

Cut()

Cuts the selected area in the current image to the clipboard.  The format in which the data is copied is determined by the ClipboardFormat property.  The area that is exposed by the Cut() is filled with white color.  If no area is selected in the current image, then the entire image is cut to the clipboard.

DiscardUndoInfo()

Discards internal information maintained to undo the most recent edit operation.  This option is relevant only if the `AllowEdit' property is set to TRUE.  This method can be used if the image OCX is used in a container's context where some other edit operation is more recent than the image's edit operation and so the image's undo information can be discarded.

ExportFileAs()

When this method is called, a dialog will be provided which will allow the user to specify the export file specification, format, datatype, compression scheme, and compression quality. When the user presses the "OK" button on the dialog, the image is exported.

ExportStream(VARIANT by reference)

When this method is called, the current image will be exported to the stream defined by the VARIANT parameter. The VARIANT parameter must be of type VT_IUNKNOWN, and the punkVal must be set to point to an ILockBytes interface. The export will take place using the format, datatype, and compression scheme specified by the ExportFormat, ExportDatatype, ExportCompression, and ExportCompressionQuality properties, respectively.

ExportStreamAs(VARIANT by reference)

When this method is called, a dialog will be provided which will allow the user to specify the export format, compression scheme, and compression quality. When the user presses the "OK" button on the dialog, the image is exported to the stream defined by the VARIANT parameter. The VARIANT parameter must be of type VT_IUNKNOWN, and the punkVal must be set to point to an ILockBytes interface.

ImportFileAs()

When this method is called, a dialog will be provided which will allow the user to specify the import file specification and format. When the user presses the "OK" button on the dialog, the image is imported.

ImportStream(VARIANT by reference)

When this method is called, an image will be imported from the stream defined by the VARIANT parameter. The VARIANT parameter must be of type VT_IUNKNOWN, and the punkVal must be set to point to an ILockBytes interface.

Paste()

Pastes the image data from the clipboard to the current image starting at the left top corner of the current selection.  If there is no selection, then the paste data is centered within the image.  If the current image is empty, then a new image is created that has the same data as the clipboard image.

Rotate(DEGREES as SHORT)

Rotates the image by the angle given in the parameter.  The angle is specified in degrees.  A positive value for angle rotates the image in the clockwise direction and a negative value rotates it in the counter clockwise direction.

ShowImageInfo()

Displays a dialog box that shows the current image's information like width, height, datatype, compression and size.

Undo()

Reverts the most recent edit operation on the current image.  This method can be invoked only if the `AllowUndo' property is set to TRUE.  At any time, only one level of undo is possible.

SaveAs(BSTR FAR* FileSpec)

When this function is called with a fully qualified filename, the current image will be immediately exported. Note that the current values of ExportFormat, ExportDatatype, ExportCompression, and ExportCompressionQuality will be used during the export process.

SelectAll()

Selects the entire image.  A selection rectangle is drawn around theboundary of the entire image.

GetSelectRect(short FAR* left, short FAR* top, short FAR* right, short FAR* bottom)

Returns the current selection rectangle.  All four values are set to zero if there is no current selection rectangle.

DeleteImage()

Deletes the current image from the OCX.  This method reverts the OCX to its

initial NULL state.  Note that this method is provided to clean up the OCX, and is not a editing operation like "cut".  So you will NOT be able to Undo the effect of this method.

Events

RightClick

This event is delivered when the user clicks the right mouse button while the Image OCX is active.

RightClickXY (short x, short y)

This event is delivered when the user clicks the right mouse button while the Image OCX is active similar to the "RightClick" event.  In addition, this event returns the coordinate of the mouse click.


No Help Available

No help is available for this area of the window.


No Help Available

No help is available for this message box.

<< If you wish to author help specific to each message box prompt, then remove the AFX_HIDP_xxx values from the [ALIAS] section of your .HPJ file, and author a topic for each AFX_HIDP_xxx value.  For example, AFX_HIDP_INVALID_FILENAME is the help topic for the Invalid Filename message box. >>


AllowEdit

Determines whether or not the user will be allowed to make changes to the image


AllowUndo	BOOL

Determines whether or not undoing of edit operations is required.  In-memory temporary copies of image needs to be maintained to support undo and this can be expensive for large images.  This property lets the users turn undoing support on/off depending on their requirements.  By default, this property is set to FALSE.


BorderStyle	SHORT

Returns or sets the border style for an OCX custom control. This is a stock property.


CenterImage	BOOL

Determines whether or not the image will be centered within the OCX's view.  By default the image will be displayed starting at the top left corner of the view.  If the size of the image is bigger than the view size or if the DisplayMode is set to `Fit to view', then this property is not relevant.


ClipboardFormat	SHORT

Specifies the formats in which data will be copied to the clipboard.  It can be one of DIB, Bitmap or Both.


DisplayMode	SHORT

Specifies the mode in which the image will be displayed in the OCX's view.  It can be one of Normal, Best fit, Fit to view or Use actual size.  In `Normal' display mode, one pixel of the image is mapped to one pixel in the screen.  In `Best fit' mode, the image is fit best to either the width or height of the view and the aspect ratio is also preserved.  In `Fit to view' mode, the entire image is fit into the size of the view without maintaining the aspect ratio.  In `Use actual size' mode, the displayed image has the same physical size in inches as the original image.


Dither	BOOL

Determines whether or not the image will be dithered during display.  By default the image will be dithered if it is displayed in a device that has lesser color capability than the image.


Enabled	BOOL

Indicates whether the Image OCX is enabled. This is a stock property.


ExportCompression	BOOL

Indicates whether or not the current image should be compressed during export. Note that the value of this property is merely a request to the Image OCX; for example, if the current ExportFormat supports only compressed (or uncompressed) data, the value of this property is ignored. The default value of this property is FALSE.


ExportCompressionQuality	SHORT

When compression is available for the current ExportFormat, this property indicates the level of compression desired. The values for this property range from "Maximize Integrity" to "Maximize Compression". Note that this property is merely a request to the Image OCX; for example, if the current ExportFormat supports only lossless compression, the value of this property is ignored. The default value of this property is "Maximize Integrity".


ExportDatatype	SHORT

Identifies the datatype for a subsequent export operation (mono, grayscale, 8-bit LUT, 24-bit RGB, etc.). Note that this property is merely a request to the Image OCX; for example, if the current ExportFormat only supports 24-bit RGB, the value of this property is ignored. The default value of this property is "Automatic".


ExportFileSpec	BSTR

When this property is set to a fully qualified filename, the current image will be immediately exported. Note that the current values of ExportFormat, ExportDatatype, ExportCompression, and ExportCompressionQuality will be used during the export process.


ExportFormat	BSTR

Identifies the image format to be used for a subsequent image export operation. The default value of this property is "TIFF".


HasImage	BOOL

Determines whether or not there is a valid image associated with the image OCX.  When the OCX is first created, there is no image associated with it.  To associate an image with an image OCX, one of the import methods, Paste(), or CreateNew() must be called.


ImageCompression	BSTR (read-only)

This read-only property identifies the compression scheme of the most recently imported image.


ImageDatatype	SHORT (read-only)

This read-only property identifies the datatype (mono, grayscale, 8-bit LUT, 24-bit RGB, etc.) of the current image.


ImageFormat	BSTR (read-only)

Gets the format identifier of the current image.


ImageHeight	LONG (read-only)

Gets the height of the current image, in pixels. If there is no image, this value is zero.


ImageWidth	LONG (read-only)

Gets the width of the current image, in pixels.  If there is no image, this value is zero.


ImageXResolution	LONG (read-only)

Gets the horizontal resolution of the current image, in pixels. If there is no image, this 	value is zero.


ImageYResolution	LONG (read-only)

Gets the vertical resolution of the current image, in pixels. If there is no image, this 	value is zero.


ImportFileSpec	BSTR

When this property is set to a fully qualified filename, the referenced image will be immediately imported. The format, datatype, and compression scheme of the image will be automatically identified by the Image OCX.


IsModified	BOOL

Indicates whether the current image has been modified in any way since the most recent import operation.


Palette	SHORT

Specifies the palette to use to display the current image.  It can be one of `Image palette', `Current device palette' or `Fixed rainbow palette'.  If palette is set to `Image palette', the current image's palette will be used.  If palette is set to `Current device palette', the image will be displayed using the palette already available in the current display device.  If palette is set to `Fixed rainbow palette', a 256 color rainbow palette is used to display the image.  By default, the `Palette' property is set to `Image palette'.


SelectionRectangle	RECT

Specifies the rectangular area within the image that will be shown selected.  This area is clipped to the dimensions of the current image.  The selection rectangle will be used in image edit operations like cut, copy and paste.


ShowToolPalette	BOOL

Determines whether or not tool palette is displayed inside the image view.  The tool palette will have controls to do zoom, rotate, etc., with which the user can manipulate the image.  By default the tool palette is not displayed.


Visible	BOOL

Determines whether the image OCX's view box is visible or hidden.  By default the image OCX is visible.


ZoomFactor	SHORT

Specifies the percentage by which the image is zoomed up during display.  The default value for this property is 100.  Note that when the DisplayMode property is set to `Fit to view' or `Best Fit', this property is not relevant.


Copy()

Copies the selected area in the current image to the clipboard.  The format in which the data is copied is determined by the ClipboardFormat property.  If no area is selected in the current image, then the entire image is copied.


Cut()

Cuts the selected area in the current image to the clipboard.  The format in which the data is copied is determined by the ClipboardFormat property.  The area that is exposed by the Cut() is filled with white color.  If no area is selected in the current image, then the entire image is cut to the clipboard.


DiscardUndoInfo()

Discards internal information maintained to undo the most recent edit operation.  This option is relevant only if the `AllowEdit' property is set to TRUE.  This method can be used if the image OCX is used in a container's context where some other edit operation is more recent than the image's edit operation and so the image's undo information can be discarded.


ExportFileAs()

When this method is called, a dialog will be provided which will allow the user to specify the export file specification, format, datatype, compression scheme, and compression quality. When the user presses the "OK" button on the dialog, the image is exported.


ExportStream(VARIANT by reference)

When this method is called, the current image will be exported to the stream defined by the VARIANT parameter. The VARIANT parameter must be of type VT_IUNKNOWN, and the punkVal must be set to point to an ILockBytes interface. The export will take place using the format, datatype, and compression scheme specified by the ExportFormat, ExportDatatype, ExportCompression, and ExportCompressionQuality properties, respectively.


ExportStreamAs(VARIANT by reference)

When this method is called, a dialog will be provided which will allow the user to specify the export format, compression scheme, and compression quality. When the user presses the "OK" button on the dialog, the image is exported to the stream defined by the VARIANT parameter. The VARIANT parameter must be of type VT_IUNKNOWN, and the punkVal must be set to point to an ILockBytes interface.


ImportFileAs()

When this method is called, a dialog will be provided which will allow the user to specify the import file specification and format. When the user presses the "OK" button on the dialog, the image is imported.


ImportStream(VARIANT by reference)

When this method is called, an image will be imported from the stream defined by the VARIANT parameter. The VARIANT parameter must be of type VT_IUNKNOWN, and the punkVal must be set to point to an ILockBytes interface.


Paste()

Pastes the image data from the clipboard to the current image starting at the left top corner of the current selection.  If there is no selection, then the paste data is centered within the image.  If the current image is empty, then a new image is created that has the same data as the clipboard image.


Rotate(DEGREES as SHORT)

Rotates the image by the angle given in the parameter.  The angle is specified in degrees.  A positive value for angle rotates the image in the clockwise direction and a negative value rotates it in the counter clockwise direction.


ShowImageInfo()

Displays a dialog box that shows the current image's information like width, height, datatype, compression and size.


Undo()

Reverts the most recent edit operation on the current image.  This method can be invoked only if the `AllowUndo' property is set to TRUE.  At any time, only one level of undo is possible.


SaveAs(BSTR FAR* FileSpec)

When this function is called with a fully qualified filename, the current image will be immediately exported. Note that the current values of ExportFormat, ExportDatatype, ExportCompression, and ExportCompressionQuality will be used during the export process.


SelectAll()

Selects the entire image.  A selection rectangle is drawn around theboundary of the entire image.


GetSelectRect(short FAR* left, short FAR* top, short FAR* right, short FAR* bottom)

Returns the current selection rectangle.  All four values are set to zero if there is no current selection rectangle.


DeleteImage()

Deletes the current image from the OCX.  This method reverts the OCX to its

initial NULL state.  Note that this method is provided to clean up the OCX, and is not a editing operation like "cut".  So you will NOT be able to Undo the effect of this method.


RightClick

This event is delivered when the user clicks the right mouse button while the Image OCX is active.


RightClickXY (short x, short y)

This event is delivered when the user clicks the right mouse button while the Image OCX is active similar to the "RightClick" event.  In addition, this event returns the coordinate of the mouse click.