GxImage

GxImage


Version 7.2.10

The GX Image Control is a dedicated ActiveX control for displaying and handling images stored in gxImage structures.

In the GX ActiveX system the images drift from the sources to the image containers. For example an FXVD4 control is an image source, an ANPR control is an image holder. The GX Image control can be both source and container in the same time.

The connection between the sources and containers should be specified at initialization time. This is a permanent connection, that cannot be closed, but changing the source is permitted.

On runtime the sources send notifications to the containers when the source images are changed. If the AutoUpdateImage property is set the control automatically updates the image every time when the image source changed notification arrives. Refreshing the image shown inside of the control is controlled by the AutoRefresh property. In case of multiple operation on the source side it is recomended turning the AutoRefresh property in FALSE before starting the modifications and turning back to TRUE again at the end. This increases the applications response speed, because the internal images are not displayed.

If an image manipulation method (LoadImage, RotateImage) is called on the target side then the automatic image update will stop, even when the AutoUpdateProperty is set. This is a way for connection hangup. The connection is restored only when the UpdateImage method is called, and it is not influenced by changing the AutoUpdateImage property.

You have to lock the image object if you want to manipulate the pixels in the image and unlock at the end of the image processing.
For example: mixing two image, filtering the image, making some effect on the image.
Use the LockImage/UnlockImage methods of the control to lock/unlock the image object. If the image object is locked you can read the properties of the image (ImagePtr, Format, XSize, YSize, Sline, HRes, VRes, ImageObject) and the view image (ViewPtr, ViewXSize, ViewYSize, ViewSLine) and using of the most properties and function of the GxImage ActiveX is forbidden. If the image object is locked and the program hangs after changing a property or using a method of the GxImage control, it is indicative of the property changing or method calling is forbidden.
If the image object is locked the locking thread can change the image, other threads cannot.

The precedence list of the display properties:

  1. Image area selection
  2. Image rotation
  3. Image mirroring

Note: To compile the samples in the SDK under Delphi please install the GxImage ocx to the Delphi ActiveX components as TGxImageOCX class.

Developing on Windows XP x64 operating system

The 64-bit ActiveX controls cannot be accessed in Visual Studio 2005 (VS2005) because the editor is a 32-bit program. Therefore in design mode the 32-bit ActiveX controls are used, but in runtime mode the .NET Framework 2.0 causes the built program to use the 64-bit ActiveX controls instead. If you develop a program in VS2005, you should use the 64-bit versions of the functions and properties whose names end with 64.

Note: In 32-bit programming a Long is a 32-bit integer value, an Integer is a 16-bit integer value; in 64-bit programming a Long becomes a 64-bit integer value, and an Integer becomes a 32-bit integer value. In this document a Long is a 32-bit integer value and a LongLong is a 64-bit integer value. In Visual Basic 8.0 (VS2005), the 32-bit Long parameters and properties are shown as Integer, and the 64-bit Long parameters and properties are shown as Long. In Delphi the 32-bit Long parameters and properties are shown as Integer, and the 64-bit Long parameters and properties are shown as OleVariant. In Visual C++ 6.0 the 64-bit versions of functions and properties of the ActiveX controls cannot be accessed. In Visual C++ 8.0 the GxImage ActiveX control cannot be loaded because the changed version number of the GxImage ActiveX control causes an unknown error, possibly a bug in Visual C++ 8.0.


Class Diagram

GxImage

Public:

Types:

NameDescription
 enumDrawMode Drawing modes  
 enumDrawStyle Drawing styles  
 enumFileFormat File types for saving images  
 enumFormat Values of the format property  
 enumLineStyle Line styles  
 enumMirrorFlag Mirroring modes  
 enumStretchMode Values of the stretchmode property  
 enumViewMode Values of the viewmode property  

Methods:

NameDescription
 ClearDrawingThis method clears the current drawing objects from the image.  
 ClearImageThis method clears the current image.  
 ConnectThis method connects the control as an image container object to an image source object.  
 ConvertImageThis method changes the size and/or format of the control's image.  
 CopyImageThis method copies the image to the clipboard.  
 CopyViewThis method copies the actual view of the image to the clipboard.  
 CreateImageThis method creates an image from an external (custom) source.  
 DrawLineThis method draws a line between (x1,y1) and (x2,y2) points. The coordinates must be in image coordinates.  
 GetErrorThis method returns the error code and string of the control.  
 GetErrorCodeThis method returns the error code of the control.  
 GetErrorStringThis method returns the error string of the control.  
 GetImageSourceThis method returns a binary value representing the control's class as an image source.  
 GetIntPropertyThis method gets an integer property of the GxImage module.  
 GetPropertyThis method gets a property of the GxImage module.  
 GetSourceHandleThis method returns a binary value representing the control's object as a source handle.  
 HMirrorImageThis method mirrors the control's image horizontally.  
 ImagePosToScreenPosThis method converts image coordinates to screen coordinates.  
 ImagePosToScreenPosVThis method converts image coordinates to screen coordinates.  
 ImagePosToViewPosThis method converts image coordinates to viewed image coordinates.  
 ImagePosToViewPosThis method converts image coordinates to viewed image coordinates.  
 LineToThis method draws a line from the drawing cursor to the (x,y) point. The coordinates must be in image coordinates.  
 LoadFromMemThis method loads an image from a memory buffer.  
 LoadImageThis method loads the image from a specified file.  
 LockImageThis method lock the image of the control. If you want to manipulate the pixels of the image lock the image by calling the LockImage method.  
 MoveToThis method moves the drawing cursor to the (x,y) point. The coordinates must be in image coordinates.  
 PasteImageThis method inserts an image from the clipboard.  
 RotateImageThis method rotates the control's image.  
 SaveImageThis method saves the image to a file.  
 SaveViewThis method saves the view image to a file.  
 ScreenPosToImagePosThis method converts screen coordinates to image coordinates (use for mouse event coordinates).  
 ScreenPosToImagePosVThis method converts screen coordinates to image coordinates (use for mouse event coordinates).  
 ScreenPosToViewPosThis method converts screen coordinates to viewed image coordinates (use for mouse event coordinates).  
 ScreenPosToViewPosVThis method converts screen coordinates to viewed image coordinates (use for mouse event coordinates).  
 SetIntPropertyThis method sets an integer property of the GxImage module.  
 SetWindowRectThis method sets the drawable area in one step.  
 SetZoomPosThis method sets the zoom position in one step.  
 UnlockImageThis method unlock the image of the control. If youve finished the image manipulating unlock the image by calling the UnlockImage method.  
 UpdateImageThis method updates the image of the control by getting the image from the image source to which it is connected to.  
 ViewPosToImagePosThis method converts viewed image coordinates to image coordinates.  
 ViewPosToImagePosVThis method converts viewed image coordinates to image coordinates.  
 ViewPosToScreenPosThis method converts viewed image coordinates to screen coordinates.  
 ViewPosToScreenPosVThis method converts viewed image coordinates to screen coordinates.  
 VMirrorImageThis method mirrors the control's image vertically.  

Events:

NameDescription
 ClickOccurs when the user presses and then releases a mouse button over an object.  
 DblClickOccurs when the user presses and releases a mouse button and then presses and releases it again over an object.  
 ImageUpdateOccurs when the image of the ActiveX control is updated  
 KeyDownOccurs when the user presses a key while an object has the focus.  
 KeyPressOccurs when the user presses and releases an ANSI key.  
 KeyUpOccurs when the user releases a key while an object has the focus.  
 MouseDownOccurs when the user presses a mouse button.  
 MouseMoveOccurs when the user moves the mouse.  
 MouseUpOccurs when the user releases a mouse button.  

Private:

Properties:

NameDescription
 AutoRefreshThis property enables/disables the automatic image redrawing when the image or the display parameters are changed.  
 AutoSizeThis property enables/disables the automatic resizing of the control's window to the size of its image.  
 AutoUpdateImageThis property enables/disables the automatic image update from the connected source.  
 BackColorThe background color of the control.  
 BrightnessAdjusting view image brightness.  
 ContrastAdjusting view image contrast.  
 DrawModeMode for line drawing.  
 DrawStyleStyle for line drawing.  
 Format[Read only] Image format.  
 GammaAdjusting view image gamma value.  
 HasWindowThis property enables/disables the window of the control.  
 HResHorizontal resolution.  
 HZoomPosThe horizontal coordinate of the zoom position when the view mode is vmZoom.  
 ImageBitmapThe image converted to HBITMAP. Ability to copy an image as HBITMAP from the GxImage control.  
 ImageBitmap64The image converted to HBITMAP for 64-bit developing. Ability to copy an image as HBITMAP from the GxImage control.  
 ImageObject[Read only] Handle for the image of the control.  
 ImageObject64[Read only] Handle for the image of the control for 64-bit developing.  
 ImageOLEPicture[Read only] The image converted to OLE Picture.  
 ImagePtr[Read only] Image pointer to the source image.  
 ImagePtr64[Read only] Image pointer to the source image for 64 bit developing.  
 ImgSrcParamParameter string given for the image source control when updating the image.  
 LineBkColorBackground color for line drawing.  
 LineColorPen color for line drawing.  
 LineStyleLine style for line drawing. The lsDash and lsDot style are visible only if LineWidth is 1, otherwise the line style should be set to lsSolid.  
 LineWidthPen width for line drawing.  
 MirrorMirroring direction for displaying the image.  
 RotationRotation angle (in degrees) for displaying the image. The permitted values are 0, 90, 180 and 270.  
 RuntimeConfigConfigures the ActiveX control for the runtime enviroment.  
 SaturationAdjusting view image saturation.  
 SaveQualityThe quality of the JPEG image at saving.  
 SLine[Read only] The number of bytes in one image line.  
 StretchImageThis property specifies whether the control should stretch the image to the control's whole area or to preserve the image's aspect ratio.  
 StretchModeStretch method for displaying the image. The availbale values are defined in enumStretchMode enumeration.  
 Version[Read only] The version of the GxImage ActiveX control  
 ViewBitmap[Read only] The view image converted to HBITMAP.  
 ViewBitmap64[Read only] The view image converted to HBITMAP for 64-bit developing.  
 ViewModeView mode of the control. The available values are defined in the enumViewMode enumeration.  
 ViewOLEPicture[Read only] The view image converted to OLE Picture.  
 ViewPtr[Read only] Image pointer to the image view.  
 ViewPtr64[Read only] Image pointer to the image view for 64 bit developing.  
 ViewSline[Read only] The number of bytes in one view line.  
 ViewXSize[Read only] Image width of the view in pixels.  
 ViewYSize[Read only] Image height of the view in pixels.  
 VResVertical resolution.  
 VZoomPosThe vertical coordinate of the zoom position when the view mode is vmZoom.  
 WndBottomThe bottom side of the drawable area of the image when the view mode is vmPart.  
 WndLeftThe left side of the drawable area of the image when the view mode is vmPart.  
 WndRightThe right side of the drawable area of the image when the view mode is vmPart.  
 WndTopThe top side of the drawable area of the image when the view mode is vmPart.  
 XSize[Read only] Image width in pixels.  
 YSize[Read only] Image height in pixels.  
 ZoomThe zoom ration when the view mode is vmZoom.  
History