Northeast Data Corp.

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


Properties

hdcPrn PCDRes Picture
PrintDestHeight PrintDestLeft PrintDestTop
PrintDestWidth PrintBorderWidth PrintSrcHeight
PrintSrcLeft PrintSrcTop PrintSrcWidth
Rotation ScaleMode ScalePercent
ScaleToGray ScrollBars VScrollPos
HScrollPos Menus Colors
ImageWidth ImageHeight

Methods

Copy DecreaseContrast IncreaseContrast PrintImage
SaveAs ZoomIn ZoomOut

Events

MenuChange SelectRectangle PrintComplete
Properties
The notation (rw) is used below to indicate if a property is Read, Write, or both


[Back to Top]


hdcPrn (rw)

The HDC to use for printing. If you specify 0 (the default), the NED PhotoV ActiveX control displays a print setup dialog box, which allows the user to choose a printer. The control performs the StartDoc and StartPage functions, prints the image, fires the PrintComplete event, performs the EndPage function, and performs the EndDoc function. 

If you specify a non-zero value, the NED PhotoV ActiveX control only performs the rendering of the image to the printer. It also fires the PrintComplete event after printing the image. In this mode, you must call the StartDoc and StartPage functions before invoking the PrintImage method. After the method completes, you must call the EndPage and EndDoc functions. In Visual Basic, StartDoc and StartPage are implicitly performed when you print anything to the Printer object. EndPage is implicitly called when you use the VB EndDoc function.

In either mode of operation, you can use the PrintComplete event to do your own custom drawing to a page. If you specify a non-zero value for hdcPrn, you have the option of doing your own drawing after the PrintImage method returns, since the NED PhotoV ActiveX control does not do the EndPage function.

You MUST supply a valid HDC for this property. You normally do this by using the hdc property of the Printer object.


[Back to Top]


PDCRes (rw)

Resolution of PhotoCD image to extract from file. Values are:

1 = BASE/64 (64x96)
2 = BASE/16 (128x192)
3 = BASE/4 (256x384)
4 = BASE (512x768)
5 = 4BASE (1024x1536)
6 = 16BASE (2048x3072)

Specifying a higher resolution requires much more processing time and memory. BASE/4 gives the best performance/appearance and is the default value.

PCD files are not required to contain all resolutions. If you specify a resolution that does not exist, the NED PhotoV ActiveX control will retrieve the next-lower resolution. If a lower resolution is not available, the next-higher available resolution will be retrieved.

You must set this property before specifying the Picture property.  This property has no effect, and you do not have to set it, for non-PCD image files.

[Back to Top]

 

Picture (rw)

The full file specification of the file containing the image to display.

[Back to Top]

 

PrintDestHeight (rw)

Destination rectangle height in pixels for printed page.  If you specify 0, the NED PhotoV ActiveX control will print the image as closely as possible to the size of the image on the screen.

The NED PhotoV ActiveX control will stretch the image specified in the PrintSrc properties to fit this rectangle. You can use the ImageWidth and ImageHeight properties to calculate scaling and aspect ratios to construct the appropriate values for these rectangles.


[Back to Top]


PrintDestLeft (rw)

Left pixel position of image on printed page.

[Back to Top]

 

PrintDestTop (rw)

Top pixel position of image on printed page.

[Back to Top]

 

PrintDestWidth (rw)

Pixel width of image on printed page. If you specify 0, the NED PhotoV ActiveX control will print the page as closely as possible to the size of the image on the screen.

[Back to Top]

 

PrintBorderWidth (rw)

The width of the border to print around the image when it is printed. Default is 1 pixel.

[Back to Top]

 

PrintSrcHeight (rw)

Pixel height of image rectangle within the displayed image to print. Setting this property to 0 will print the entire image.

[Back to Top]

 

PrintSrcLeft (rw)

Pixel position of the rectangle within the displayed image to print. This value is relative to the actual image on the screen - disregarding scrollbar positions. If you want to print a rectangle within the visible image window, you can add the scrollbar setting to the offset of the rectangle from the edge of the window.

[Back to Top]

 

PrintSrcTop (rw)

Pixel postion of rectangle within the displayed image to print. See description of PrintSrcLeft.

[Back to Top]

 

PrintSrcWidth (rw)

Pixel width of image rectangle to print. If you specify 0,  the entire image is printed.

[Back to Top]

 

Rotation (rw)

0 = 0 degrees, 90 = 90 degrees, 180 = 180 degrees, and 270 = 270 degrees.

[Back to Top]

 

ScaleMode (rw)

0 = Fit Vertical, 1 = Fit Horizontal, 2 = Fit 1 to 1, 3 = Best Fit, and 4 = use ScalePercent property.

[Back to Top]

 

ScalePercent (rw)

Percent of original image size. 100 percent is the same as 1 to 1 scaling.

[Back to Top]

 

ScaleToGray (rw)

Apply scale-to-gray algorithm to bitonal images. This can make displayed or printed bitonal images more readable.  Values are TRUE or FALSE.

[Back to Top]

 

ScrollBars (rw)

0 = None, 1 = Vertical, 2 = Horizontal, and 3 = Both.

[Back to Top]

 

VScrollPos (rw)

Vertical scroll position.

[Back to Top]

 

HScrollPos (rw)

Horizontal scroll position.

[Back to Top]

 

Menus (r)

A string that contains a '0' or '1' character for each enabled (1) or disabled (0)  function. The positions in the string are:

0 = copy
1 = bestfit
2 = fitvert
3 = fithorz
4 = fit 1 to 1
5 = increase contrast
6 = decrease contrast
7 = zoom in
8 = zoom out
9 = print
10 = rotate 0
11 = rotate 90
12 = rotate 180
13 = rotate 270

If you are programming in Visual Basic, offsets are 1-based, so the copy menu has an offset of 1 into the string instead of 0.

[Back to Top]

 

Colors (r)

The number of colors in the image. This is normally 2, 16, 256, or 16777216.

[Back to Top]

 

ImageWidth (r)

The width of the current image in pixels. Zooming the image changes this value.

[Back to Top]

 

ImageHeight (r)

The height of the image in pixels. Zooming the image changes this value.

[Back to Top]

Methods

Copy

Copies selected region to clipboard.

[Back to Top]

 

DecreaseContrast

Decreases the image contrast. You can only decrease the contrast on an image after you have increased the contrast.

[Back to Top]

 

IncreaseContrast

Increases the image contrast.

[Back to Top]

 

PrintImage

Prints the image.  See the description of the hdcPrn property for details about this method.

[Back to Top]

 

SaveAs (filename, compression)

Saves the image in the specified file. The file extension indicates the type of file to save.  Here are the valid values for the compression argument as well:

BMP

0 = no compression
1 = RLE8 compression

JPG

0 - 100 for image quality. 100 gives the highest quality.  Values less than 100 produce a smaller image file, but with poorer image quality.

TGA

0 = no compression
1= RLE compression

.TIF (For bitonal images)

0 = none
1 = packbits
2 = Group 3
3 = Group 4

.TIF (For Grayscale or 8-bit images)

0 = none
2 = packbits

.TIF (For RGB (24 bit) images)

0 = none

For example, to save the current image file (assuming it is an RGB color image),

(PhotoV object name).SaveAs(c:\abc.tif,0)

The file is saved as a TIFF file with no compression.

[Back to Top]

 

ZoomIn

Zooms in on the image.

[Back to Top]

 

ZoomOut

Zooms the image out.

[Back to Top]

Events

MenuChange(menuString)

Returns a string with characters set for each function that is available. See the description of the Menus property above for the meaning of each character in the string.

[Back to Top]

 

SelectRectangle(left,top,width,height)

Called whenever the user draws a rectangle using the RIGHT mouse button. Parameters provided in the event specify the location of the selection rectangle. If width or height are 0, there is no visible selection rectangle. Values are in pixels and are relative to the image window. To determine the offset into the actual image, add the values of the scrollbar settings.  It is best not to display messageboxes in this event. This event is not fired on LEFT mouse button events.

[Back to Top]

 

PrintComplete(hdc)

Fired after the control has rendered an image to the printer DC, but before EndPage or EndDoc has been called. See the description of the hdcPrn property for more information.  You can use this event to do your own drawing to the printed page by using the hdc parameter.

[Back to Top]

 

Back ] Top ] Up ] Next ]

Northeast Data Corp.
12405 Herdon Court
Charlotte, NC  28277

nedatacorp@carolina.rr.com