Quick Links to the Properties, Methods and Events of the NED Image ActiveX Control.


 

Properties

Picture URLPicture FitType
AutoDisplay VScrollPos HScrollPos
ScrollBars ColorReductionMethod TotalRotate
NumScreenColors NumPrinterColors NumImageColors
ImageHeight ImageWidth PCDResolution
CurrentTIFFPage RenderToMemory

Methods

ErrorDiffusionDither MedianCutQuant OrderedDither
GetNumPCDResolutions GetPCDResolutions RefreshPCDResolution
CopyImageToClipboard AdvPrintStartDoc AdvPrintStartPage
AdvPrintImagePrint AdvPrintEndPage AdvPrintEndDoc
IsImageOnClipboard CreateImageFromClipboard GetNumTIFFPages
RefreshTIFFPage PopulateFromHandle Rotate90
Rotate180 Rotate270 Refresh
VFPRefresh GetLastError PrintImage
AboutBox SaveAsBMP SaveAsPCX
SaveAsJPEG SaveAsTIFF SaveAsTGA
  StopDownload

Events

Click DblClick MouseMove
DownloadComplete DownloadError DownloadProgress
Properties
 

Picture

The full file specification of the file containing the image to display. For example: c:\images\image0001.jpg Once the Picture property has been set, you can display the image
by calling the Refresh method.
[Back To Top]


URLPicture

The full URL specification of the file containing the image to display.  For example:
http://www.mynet.net/image.jpg  This will download the file from the Internet asynchronously.  Progress information will be sent back to the application through the DownloadProgress event.  When the download is complete, you will be notified through the DownloadComplete event.  Once you have received the DownloadComplete event, you can display the image by calling the Refresh method.
[Back To Top]


FitType

0 = Best Fit, 1 = Horizontal Fit, 2 = Vertical Fit, 3 = One to One
[Back To Top]


AutoDisplay

True = Displays image as soon as a image manipulation is complete.  This will NOT automatically dispaly the image until Refresh is called once.  False = Does not display image until Refresh is called.  Using AutoDisplay will immediately cause a rotate, color reduction method or FitType to be displayed if Refresh has been called once.  By setting this property to False, you can add these effects to your image before ever displaying them to the user.  This is useful for database applications that remember the prefered display type of individual images, as well as manipulating the image before printing.
[Back To Top]


VScrollPos

Value of the Vertical Scroll position.  To display the new scroll position dynamically, you must call Refresh.
[Back To Top]


HScrollPos

Value of the Horizontal Scroll position.  To display the new scroll position dynamically, you must call Refresh.
[Back To Top]


ScrollBars

True = Show scroll bars if needed.  False = Hide scroll bars.
[Back To Top]


ColorReductionMethod

Returns the type of Color reduction method used.  This is a read-only property. 1 = OrderedDither, 2 = ErrorDiffusionDither, 3 = MedianCutQuant.
[Back To Top]


TotalRotate

Returns the total amount the image has rotated.  This is a read-only property. 90 = Image has been rotated 90 degrees from original, 180 = Image has been rotated 180 degrees from original, and 270 = Image has been rotated 270 degrees from original
[Back To Top]


NumScreenColors

Returns the number of colors the display is capable of. This is a read-only property.
[Back To Top]


NumPrinterColors

Returns the number of colors the default printer is capable of. This is a read-only property.
[Back To Top]


NumImageColors

Returns the number of colors in the original image.  This is a read-only property.
[Back To Top]


ImageHeight

Returns the original image height. This is a read-only property.
[Back To Top]


ImageWidth

Returns the original image width. This is a read-only property.
[Back To Top]


PCDResolution

Sets the resolution that PCD files should be read at.  0 = Base over 64, 1 = Base over 16, 2 = Base over 4, 3 = Base, 4 = 4 Base, 5 = 16 Base, and 6 = 64 Base.
[Back To Top]


CurrentTIFFPage

Sets the current TIFF page to be displayed in the currently decompressed multi-page TIFF file.  You must call RefreshTIFFPage to update the display.  Pages are numbered starting at 1.
[Back To Top]


RenderToMemory

Displays images using faster memory routines.  True = Render to memory DC and display using fast memory routines, False = Render directly to device.  ***NOTE*** The default setting of this property is TRUE.  This may cause display problems with poorly written video or printer drivers.  If you see problems displaying or printing an image, set this property to FALSE.  It is highly recommended that you set RenderToMemory to FALSE if you wish for report previews to work under Access!

[Back To Top]

Methods

Rotate90

Rotates the image 90 degrees from its current location.
[Back to Top]


Rotate180

Rotates the image 180 degrees from its current location.
[Back to Top]


Rotate270

Rotates the image 270 degrees from its current location.
[Back to Top]


OrderedDither

Performs an ordered dither on the true color image.
[Back to Top]


ErrorDiffusionDither

Performs an error diffusion dither on the true color image.
[Back to Top]


MedianCutQuant

Performs a median cut color reduction method on the true color Image.
[Back to Top]


GetLastError

Returns the Last Error that the control encountered.  Error Values are:

0 - No Error
1 - Out of Memory
2 - No Image in Image File
3 - Image has been corrupted
4 - Image Type Not Supported
5 - Image Color Reduction Failed
6 - File Not Found
7 - Out of Virtual Address Space
8 - Error Mapping File
[Back to Top]


PrintImage

Prints the image with the FitType specified to the default printer.
[Back to Top]


Refresh

Refreshes and redraws the image.
[Back to Top]


VFPRefresh

Added so that Visual FoxPro users could see images at run-time as well as design time.  This was added because of a bug in the OLE Container support built into Visual FoxPro.
[Back to Top]


AboutBox

Displays the about box for the control.
[Back to Top]


GetNumPCDResolutions

Returns the total number of resolutions present in the current Photo CD image pack.
[Back to Top]


GetPCDResolutions

Returns the resolutions present in the specified Photo CD image pack.  The string returned contains 7 characters.  Each character is either a '1' or a '0'.  If the character is '1', that
resolution is present in the file.  If the character is '0', that resolution is not present in the file.  The positions for each resolution are:

 0 - Base over 64
 1 - Base over 16
 2 - Base over 4
 3 - Base
 4 - 4 Base
 5 - 16 Base
 6 - 64 Base

For example, if this function returns the string "0111000", the following resolutions are enclosed in the specified file:

 - Base over 16
 - Base over 4
 - Base
[Back to Top]


RefreshPCDResolution

Changes the resolution of the loaded PCD file to the resolution specified by the PCDResolution property.  If the specified resolution is not in the already loaded PCD file, the image is unloaded and no new image is available.
[Back to Top]


CopyImageToClipboard

Copies the currently loaded image to the clipboard.
[Back to Top]


SaveAsBMP(filename)

Saves the currently loaded image to the specified filename as a BMP file.  Returns True on success, False on failure.
[Back to Top]


SaveAsPCX(filename)

Saves the currently loaded image to the specified filename as a PCX file.  Returns True on success, False on failure.
[Back to Top]


SaveAsJPEG(filename, quality)

Saves the currently loaded image to the specified filename as a JPEG file using the quality value provided.  The higher the value, the better the quality.  Returns True on success, False
on failure.  Quality values are from 1 to 100.
[Back to Top]


SaveAsTIFF(filename)

Saves the currently loaded image to the specified filename as a uncompressed TIFF file.  Returns True on success, False on failure.
[Back to Top]


SaveAsTGA(filename)

Saves the currently loaded image to the specified filename as a TGA file.  Returns True on success, False on failure.
[Back to Top]


AdvPrintStartDoc(hDC, bSupplyCancel, bShowPrintDialog)

Prepares the control to begin the advanced printing feature.  This feature is great for printing custom reports.  The hDC variable is the Device Context you wish to print to.  The bSupplyCancel variable is a bool that specifies if you want a cancel dialog shown to the user.
The bShowPrintDialog variable is a bool that indicates your desire to display the printer selection dialog.  If hDC is NULL or 0 and bShowPrintDialog is FALSE, the default printer
will be used and no dialog will be presented to the user.  If hDC contians a value and bShowPrintDialog is FALSE, the supplied DC will be used for printing.  All other combinations of hDC and bShowPrintDialog result in an error and False is returned.
Returns True on success, False on failure.
[Back to Top]


AdvPrintStartPage

Starts the first or next page on an advanced print.  This function can only be called after AdvPrintStartDoc or AdvPrintEndPage.  Returns True on success, False on failure.
[Back to Top]


AdvPrintImagePrint(lLeft, lTop, lRight, lBottom)

Prints the current image in the specified rectangle specified by lLeft, lTop, lRight and lBottom.  The units specified by the rectangle must be the same as those specified by the device context.  If lLeft, lTop, lRight and lBottom are all 0, then the image is printed according to the
FitType specified as a property of the control on the entire surface of the device context.  Returns True on success, False on failure.  This should only be called after AdvPrintStartPage.
[Back to Top]


AdvPrintEndPage

Ends the currently printed page.  This function can only be called after AdvPrintStartDoc is called.  Returns True on success, and False on failure.
[Back to Top]


AdvPrintEndDoc

Ends the current advanced printing function.  This function must be called anytime AdvPrintStartDoc is called in order to free the resources associated with printing.  This is true even if any of the previous advanced printing functions fail.  The return value is True on success and False on failure if AdvPrintStartPage returns true, otherwise, the return value is undefined.
[Back to Top]


IsImageOnClipboard

Performs a check to see if the current data on the clipboard is an image (CF_DIB or CF_ENHMETAFILE).  Returns TRUE on success, FALSE on failure.
[Back to Top]


CreateImageFromClipboard

Pastes the current clipboard image into the control.  Returns TRUE on success, FALSE on failure.
[Back to Top]


GetNumTIFFPages

Returns the number of TIFF pages present in the TIFF file specified in the Picture or URLPicture property. 
[Back to Top]


RefreshTIFFPage

Display the page number specified by CurrentTIFFPage.  If the specified page is not in the already loaded TIFF file, the first page of the image is displayed.
[Back to Top]


PopulateFromHandle(HGLOBAL hGlobal)

Populates the NED Image control from the data in the hGlobal handle.  Memory is not deleted after calling.  The hGlobal memory handle MUST contain an DIB.  This function is useful for displaying images from Digital Cameras.
[Back to Top]


StopDownload

This method can be called to stop an URLPicture Internet transfer in progress.
[Back to Top]

Events

Click

Occurs when the user presses and then releases a mouse button over the control.
[Back to Top]


DblClick

Occurs when the user presses and releases a mouse button and then presses and releases it again over the control.
[Back to Top]

MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

Occurs when the user moves the mouse over the control.  Button - An integer that corresponds to the state of the mouse buttons in which a bit is set if the button is down. The button argument is a bit field with bits corresponding to the left button (bit 0), right
button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. It indicates the complete state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are pressed.  Shift - An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys. A bit is set if the key is down. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2 ). These bits correspond to the values 1, 2, and 4, respectively. The shift argument indicates the state of these keys. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT were pressed, the value of shift would be 6.  X, Y - A number that specifies the current location of the mouse pointer. The X and Y values are always expressed in terms of the coordinate system of the control.  Remarks - The MouseMove event is generated continually as the mouse pointer moves across objects. Unless another object has captured the mouse, an object recognizes a MouseMove event whenever the mouse position is within its borders.  If you need to test for the button or shift arguments, you can use constants listed in the Visual Basic (VB) object library in the Object
Browser to define the bits within the argument:

Constant (Button) ValueDescription
vbLeftButton1Left button is pressed.
vbRightButton2Right button is pressed.
vbMiddleButton4Middle button is pressed.

Constant (Shift) ValueDescription
vbShiftMask1SHIFT key is pressed.
vbCtrlMask2CTRL key is pressed.
vbAltMask4ALT key is pressed.

The constants then act as bit masks you can use to test for any combination of buttons without having to figure out the unique bit field value for each combination.  You test for a condition by first assigning each result to a temporary integer variable and then comparing the button or shift arguments to a bit mask. Use the And operator with each argument to test if the condition is greater than zero, indicating the key or button is pressed, as in this example:

LeftDown = (Button And vbLeftButton) > 0
CtrlDown = (Shift And vbCtrlMask) > 0

Then, in a procedure, you can test for any combination of conditions, as in this example:

If LeftDown And CtrlDown Then...

Any time you move a window inside a MouseMove event, it can cause a cascading event. MouseMove events are generated when the window moves underneath the pointer. A MouseMove event can be generated even if the mouse is perfectly stationary.
[Back to Top]


DownloadComplete(BOOL bSuccess, LPCTSTR szTempFileName)

This event occurs after the completion of setting the URLPicture property.  The bSuccess variable indicates success or failure of the download.  The szTempFileName variable represents the temporary file created from the download.  If the download fails, the URL specified in URLPicture  is returned in szTempFileName.
[Back to Top]


DownloadError(long hrError)

This event occurs if an error occurs while downloading the image represented by the URL in the URLPicture property.  Error codes can be any one of the following:
 

-2146697214 = Invalid UTL
-2146697213 = No session
-2146697212 = Cannot connect
-2146697211 = Resource not found
-2146697210 = Object not found
-2146697209 = Data not available
-2146697208 = Download Failure
-2146697207 = Authentication required
-2146697206 = No valid media
-2146697205 = Connection timeout
-2146697204 = Invalid request
-2146697203 = Unknown protocol
-2146697202 = Security problem
-2146697201 = Cannot load data
-2146697200 = Cannot instantiate object
[Back to Top]


DownloadProgress(short nProgress)

This event occurs when progress is made during an internet download.  This can be used for updates to a progress indicator while downloads occur.
[Back to Top]

 

Northeast Data Corp
Charlotte, NC 
nedatacorp@carolina.rr.com