ImageKit8 ActiveX: Frequently Asked Questions
Below are a few of the most frequently asked questions by users of the ImageKit8 ActiveX. Click on the question number to jump to the answer.
No. | Question | Date |
34 | Q. There are Tiff(Jpeg compression) images that the ImageKit8 can load and other Tiff(Jpeg compression) images that it cannot load. What is the difference between these images? | N/A |
A. Tiff(Jpeg compression) images whose compression tag is 6 (old compression format) cannot be loaded into the ImageKit. Tiff(Jpeg compression) images whose compression tag is 7 (new compression format) can be loaded into the ImageKit. | ||
33 | Q. How can I "mirror" or "flip" an image? | N/A |
A. Use the Effect.Rotation method. Set the angle parameter to 0. Then, to "mirror" the image, set the xTurn parameter to true. This will reverse the image along the X axis. To "flip" the image, set the yTurn parameter to true. This will reverse the image along its Y axis. | ||
32 | Q. When I deploy an application built with Visual Studio .NET managed code, the portion of the application that corresponds with the Picture property does not work correctly. What can I do? | N/A |
A. You need to also deploy the stdole.dll (Primary Interop Assembly) with your application. | ||
31 | Q. When drawing text or shapes on an image, if I have to draw many things, my program slows down. Is there a way to speed up drawing? | N/A |
A. When drawing text or shapes multiple times on a single image,
instead of using the PrintDraw method and drawing directly to the ImageHandle,
draw to the ImageHdc. Once the drawing is complete, execute the Edit.Modify
method to transfer changes from the Image.Hdc to the ImageHandle. With the ImageKit8 DLL version, there is no Editing mode so there is no way to shorten the drawing time. |
||
30 | Q. I have an image with a the bitcount less than 8 (Black and white, 16 colors, 256 colors) and I want to draw text or shapes on it. How can I know what colors are available? | N/A |
A. You can only draw using the colors that are available in the image's color palette. To find out what color palette the image uses, execute the GetPalette method (or the IKGetPalette function) | ||
29 | Q. Using a custom-built scan interface (Scan.UIMode=2), how can I scan multiple areas on the same paper? | N/A |
A. It is not possible to scan multiple areas simultaneously so you
must execute the scan multiple times: Example: Scanning multiple times from the document plate Visual Basic Dim Index(0 To 2) As Long If ImageKit1.Scan.Initialize(hWnd, 1, 0, "1.00", "NEWTONE Corp.", "ImageKit", "ImageKit8 Scan Sample") = False Then Exit Sub ImageKit1.Scan.ClearProperty ImageKit1.Scan.DsName = "xxxxxxx" 'Datasource name If ImageKit1.Scan.OpenDS = False Then ImageKit1.Scan.Terminate Exit Sub End If ImageKit1.Scan.TransferMode = 2 ImageKit1.Scan.Compression = 0 ImageKit1.Scan.UiMode = 2 ImageKit1.Scan.ScanMode = 0 ImageKit1.Scan.UnitMode = 0 ImageKit1.Scan.PaperSize = 0 'or default value 'First scan 'set the scanning area ImageKit1.Scan.RectLeft = 0 ImageKit1.Scan.RectTop = 0 ImageKit1.Scan.RectRight = 1 ImageKit1.Scan.RectBottom = 1 'set other necessary properties here ImageKit1.Scan.Exec(Index(0)) 'second scan 'set the scanning area ImageKit1.Scan.RectLeft = 3 ImageKit1.Scan.RectTop = 3 ImageKit1.Scan.RectRight = 4 ImageKit1.Scan.RectBottom = 4 'set other necessary properties here ImageKit1.Scan.Exec(Index(0)) ImageKit1.Scan.CloseDS ImageKit1.Scan.Terminate Note: Appropriate code to display or save scanned data should be written in the AfterScan event. Also see Item No. 25 |
||
28 | Q. I have built my own scan interface (Scan.UIMode = 2) and would like to be able to use the scanner's automatic paper detection functions. How do I do that? | N/A |
A. To confirm that your scanner supports automatic paper detection,
use the IsCapSupported method (ImageKit ActiveX version) or the
IKIsCapSupported function (ImageKit DLL version). If the scan datasource supports automatic detection, set the PaperSize to 1000 (undefined) and the BorderDetection to True (0 in DLL version). For some datasources, the BorderDetection property value is ignored. |
||
27 | Q. I am trying to use a 4 bit color image in the Layer property with transparency but I am having trouble. What should I do? | N/A |
A. There are cases when there are too few colors in the palette and transparency will not work. use the ConvertColor method to increase the colors to 8 bit color. | ||
26 | Q. When using the PrintDraw interface's DrawText method (or the Print DLL's IKDrawText function) and I set the space between characters (CharExtra > 0), some characters overlap. What should I do? | N/A |
A. Use the TextOut method (DLL IKTextOut function) instead. | ||
25 | Q. I have built a custom scan interface and want scan to only a portion of a document. How can I do that ? | N/A |
A.
(1) When the scan datasource supports defined paper sizes: Set the scan area and then set the PaperSize property to 0 or to the default value. (2) When the scan datasource does not support defined paper sizes: Set the scan area and then set the PaperSize property to 0 For more details, please refer to the PaperSize property's explanation in the Help documentation. To retrieve the paper sizes supported by the scan datasource, please use the ScanGetCapEnum method (In ImageKit8 DLL version, use the IKScanGetCapEnum function). |
||
24 | Q. I am using the ImageKit8 in a web application and when the CAB file is downloaded from the server to the client PC, Internet Explorer crashes. Hey, what gives!? | N/A |
A. Do you have the Google Toolbar installed in Internet Explorer? If so, disable the Popup Blocker in the Google Toolbar options and try the web application again. | ||
23 | Q. Does the ImageKit8 support SVG compressed image format? | N/A |
A. No, the ImageKit8 does not support SVG compressed image format. | ||
22 | Q. I want to delete a specific page in a multipage file. How can I do that? | N/A |
A. There is no direct function in the ImageKit8 for deleting a
specified page in a multipage file. Therefore, you must create a temporary file
and save all the required pages in their proper order, leaving out the page
that you want to delete. Example in Visual Basic: Deleting the third page of a multipage tiff file... Dim I As Integer Dim SaveType As Long 'The temporary file name ImageKit2.File.FileName = App.Path + "\temp.tif" 'Enable TiffAppend for creating multipage tiff files ImageKit2.File.TiffAppend = True ImageKit1.LayerNo = -1 ImageKit1.File.FileName = App.Path + "\abc.tif"'The file name If ImageKit1.File.GetImageFileType() = False Then Exit Sub 'Used by SaveFile method. This will save the file in the same format. SaveType = ImageKit1.File.FileType - 3 For I = 1 To ImageKit1.File.FileMaxPage If I <> 3 Then ImageKit1.File.LoadPage = I - 1 ImageKit1.File.LoadFile (ikLoad) ImageKit2.File.SaveFile SaveType, ImageKit1.ImageHandle End If Next I Kill ImageKit1.File.FileName 'delete file Name ImageKit2.File.FileName As ImageKit1.File.FileName 'Change file name |
||
21 | Q. I know the ImageKit8 ActiveX supports TWAIN Standard Capability but what about Custom Capability? | N/A |
A. Yes, the ImageKit8 ActiveX supports Custom Capability from the
following 4 scanner manufacturers; Epson, Panasonic, Canon, and PFU (Fujitsu). 1.)Epson: Scanning Speed Unsharpness Mask Moire Filter Autodetect Paper Size Gamma Adjustment B&W/Color Ratio Detection Skip Blank Page Punch Hole Removal Focus Point Adjustment Character Enhancement Reflective Scanning / Positive Film 2.) Panasonic B&W/Color Detection Dynamic Threshold Scanning Speed Image Quality Deskew Smoothing Multistream Skip Blank Page Punch Hole Removal 3.) Canon DR Dropout Color Autodetect Paper Size Moire Filter B&W/Color Detection Image Rotation Text Orientation Detection Edge Enhancement Skip Blank Page Punch Hole Removal Text Enhancement Multistream 4.) PFU B&W/Color Detection Multistream |
||
20 | Q. What is the version of SXF that is supported by the ImageKit8 ActiveX? | N/A |
A. The ImageKit8 ActiveX supports version 3 level 2. However, there are some items, hatching for example, that are not supported. | ||
19 | Q. In the image-editing toolbar, there is an "Undo" command. Is it possible to also do a "Redo"? | N/A |
A. No, a "Redo" is not possible. | ||
18 | Q. Is it possible to edit a vector image without using the image-editing toolbar? | N/A |
A. No, it is not possible. Unfortunately, the commands used to draw vector images are not public so they cannot be accessed directly to edit vector images. | ||
17 | Q. In Visual C++ how can I change the size of the control at runtime? | N/A |
A. Example - Changing the size of the ImageKit Control: CRect rc; m_ImageKit.GetWindowRect(rc); ScreenToClient(rc); rc.right += (int)(rc.Width() * 0.5); rc.bottom += (int)(rc.Height() * 0.5); m_ImageKit.MoveWindow(rc, TRUE); |
||
16 | Q. Even though I draw text to the memory handle of an raster image in the ImageKit Control's Layer interface, the text will not display! | N/A |
A. For images displayed in the ImageKit Control's Layer interface,
transparency information is loaded when the memory handle of the image is
passed into the Layer.ImageHandle property. Drawing to the image after this
transparency information has been loaded will mean the the drawing may not be
displayed. Because the transparency information must be updated, set the
Layer.Transparent property to False before drawing to the image or pass the
image's memory handle to a variable, draw to that image and then pass the value
into the ImageHandle property.
Example: 1.) Setting the Transparent property to False: Dim Ret As Boolean 'Assumes that a raster image has already been set into the Layer interface ImageKit1.Layer(0).Transparent = False ' first set the transparent property to false. ImageKit1.PrintDraw.ClearProperty ImageKit1.PrintDraw.FontName = "Arial" ImageKit1.PrintDraw.TextForeColor = RGB(255, 0, 0) ImageKit1.PrintDraw.FontSize = 10 ImageKit1.PrintDraw.FontBold = True ImageKit1.PrintDraw.FontItalic = True ImageKit1.PrintDraw.Transparent = True ImageKit1.PrintDraw.Text = "Here is some text" Ret = ImageKit1.PrintDraw.TextOut(ImageKit1.Layer(0).ImageHandle, 20, 20, ikMemoryHandle) ImageKit1.Layer(0).Transparent = True 'Now you can set the transparent property back to true. ImageKit1.Refresh 2.) Using a variable to hold the image memory handle Dim ImageHandle As Long Dim Ret As Boolean 'Assumes that a raster image has already been set into the Layer interface ImageHandle = ImageKit1.Layer(0).ImageHandle 'pass the image into the variable declared above ImageKit1.PrintDraw.ClearProperty ImageKit1.PrintDraw.FontName = "Arial" ImageKit1.PrintDraw.TextForeColor = RGB(255, 0, 0) ImageKit1.PrintDraw.FontSize = 10 ImageKit1.PrintDraw.FontBold = True ImageKit1.PrintDraw.FontItalic = True ImageKit1.PrintDraw.Transparent = True ImageKit1.PrintDraw.Text = "Some Text" 'Draw to the memory handle of the image stored in the variable Ret = ImageKit1.PrintDraw.TextOut(ImageHandle, 20, 20, ikMemoryHandle) ImageKit1.Layer(0).ImageHandle = ImageHande 'pass the image, with the text drawn on it, into the Layer.ImageHandle property ImageKit1.Refresh |
||
15 | Q. How can I create a multipage tiff file? | N/A |
A. Please refer to the example below: 1. When saving images retrieved from a document scanner or digital camera: Dim Ret As Boolean ImageKit1.File.FileName = "abc.tif" 'the filename ImageKit1.File.TiffAppend = True 'creates a multipage tiff ImageKit1.Scan.TransferMode = ikScanMemory 'or ikScanNative Ret = ImageKit1.Scan.Exec(...) 'scan 'save the file in the AfterScan event.... Private Sub ImageKit1_AfterScan(ByVal DibHandle As Long, ByVal OrgHandle As Long, ByVal ImageCount As Long, ByVal BitOrder As Integer) ImageKit1.File.SaveFile ikSaveTIFFNoncompressed, DibHandle End Sub Note: if the datasource supports file transfer of multipage tiff then it is not necessary to use the File interface at all and you can create multipage tiff images using just the Scan interface properties. 2. To load multiple image files and save them within one multipage file: Dim I As Integer ImageKit2.File.FileName = "abc.tif" 'the filename ImageKit2.File.TiffAppend = True 'multipage tiff ImageKit1.LayerNo = -1 ImageKit1.File.LoadPage = 0 'process images 001.jpg through 005.jpg For I = 1 To 5 ImageKit1.File.FileName = Format$(I, "000") & ".jpg" 'the filename ImageKit1.File.LoadFile (ikLoad) ImageKit2.File.SaveFile ikSaveTIFFNoncompressed, ImageKit1.ImageHandle Next I |
||
14 | Q.What determines the size of a thumbnail image in the Thumbnail Control? | N/A |
A. The size of a thumbnail image is mostly determined by the available display area within a thumbnail cell and the Thumbnail Control's ImageSize property. The thumbnail cell's size is determined by the number of rows and columns within the Thumbnail Control and the GapSize property. Once an individual cell's size is determined, the ImageSize property sets the maximum allowable size for thumbnail images within each cell. | ||
13 | Q. How can I convert the height of an image given in pixels to inches or centimeters? | N/A |
A. Please refer to the example below: ActiveX (VB) example ImageKit1.LayerNo = -1 ImageKit1.File.FileName = "abc.tif" If ImageKit1.File.LoadFile(ikLoad) = False Then Exit Sub Dim inchX As Single, inchY As Single Dim cmX As Single, cmY As Single If ImageKit1.Xdpi <> 0 Then 'inches inchX = ImageKit1.ImageWidth / ImageKit1.Xdpi 'convert to centimeters cmX =inchX * 2.54 End If If ImageKit1.Ydpi <> 0 Then 'inches inchY = ImageKit1.ImageHeight / ImageKit1.Ydpi 'convert to centimeters cmY = inchY * 2.54 End If |
||
12 | Q. How can I enable the "Page" settings in the Print dialog when it first appears? | N/A |
A. Please refer to the following example: Using the ActiveX version (VB): Dim Ret As Boolean ImageKit1.PrintDraw.PrintRange = 2 ImageKit1.PrintDraw.MinPage = 1 ImageKit1.PrintDraw.MaxPage = 3 ImageKit1.PrintDraw.FromPage = 1 ImageKit1.PrintDraw.ToPage = 3 Ret = ImageKit1.PrintDraw.PrintDialog() * If the MinPage and MaxPage properties are both set to 1, the "Page" settings will not be enabled. |
||
11 | Q. In the Thumbnail Control, when I use Exif files, are the thumbnail images contained within the Exif files being used by the Thumbnail Control? | N/A |
A. If the value of the ImageSize property is less than the Exif thumbnail image's height and width in pixels, then the Exif thumbnail image is used in the Thumbnail Control. | ||
10 | Q. Everything works fine in my development environment, however, in the deployment environment I cannot use certain file formats. What should I do? | N/A |
A. In the deployment environment, make sure that you have the appropriate ImageKit8 DLL files, i.e. Ik8***.dll, for that file format. When using the ActiveX version, make sure these dll files in the same folder as the OCX. When using the DLL version, make sure these dll files are in the same folder as the executable (exe) or that they are in a folder within a valid path. | ||
9 | Q. Is it possible to use the image editing toolbar to edit the raster image set in the ImageKit Control's Layer property? | N/A |
A. No, this is not possible. You can edit it using the PrintDraw interface's text or drawing methods. Unfortunately, the PrintDraw does not contain a stamp or airbrush capability. | ||
8 | Q. How can I print without displaying the Select Printer common dialog? | N/A |
A. Please refer to the following example: 1. To use the default printer... Dim Ret As Boolean ImageKit.PrintDraw.PrintFileName = "Default" Ret = ImageKit.PrintDraw.PrintCreateDC(ikPrintFileName) If Ret = False Then Exit Sub 'printing code goes here..... 2. To specify a printer.... Dim Ret As Boolean 'Set the name of the printer, retrieved by the EnumPrinters method, into the PrinterName property... ImageKit.PrintDraw.PrinterName = "xxxxxx" Ret = ImageKit.PrintDraw.PrintCreateDC(ikPrinterName) If Ret = False Then Exit Sub 'printing code..... Regarding 1 and 2 above, if you want to change print conditions, the retrieve the DEVMODE structure using the GetDevModeHandle method. Then using SetDevModeInfo set the print conditions that you want and execute the PrintCreateDC method. With both the Print interface and the Print DLL, if you want to exectue SetDevModeInfo, you must first execute GetDevModeInfo. (in Print DLL the function names are preceeded by "IK") |
||
7 | Q. I want to print an image so that it fills the printable area for a given paper size. | N/A |
A. Use GetPaperSize to retrieve the printable area and then output
the image using ImageOut. ActiveX example (VB): Dim Ret As Boolean Dim Left As Long Dim Top As Long Dim Right As Long Dim Bottom As Long Dim Width As Long Dim Height As Long 'retrieve paper size and printable area Ret = ImageKit.PrintDraw.GetPaperSize(.hDC, Left, Top, Right, Bottom, Width, Height, ikPrinter) 'print image in printable area Ret = ImageKit.PrintDraw.ImageOut(hDC, ImgHandle, 0, 0, Right - Left, Bottom - Top, False, True, ikPrinter) DLL example (VB) Dim Ret As Long Dim Rect1 As IKRECT Dim Rect2 As IKRECT Dim Width As Long Dim Height As Long 'retrieve paper size and printable area Ret = IKGetPaperSize(.hDC, Rect1, Width, Height, 1) 'print image in printable area Rect2.Left = 0 Rect2.Top = 0 Rect2.Right = Rect1.Right - Rect1.Left Rect2.Bottom = Rect1.Bottom - Rect1.Top Ret = IKImageOut(hDC, ImgHandle, Rect2, False, True, 1) |
||
6 | Q. I am having problems saving an image in JPEG file format. | N/A |
A. JPEG images must be either 8 bit grayscale or 24 bit color. If you are trying to save other types of images than these in the JPEG format, you must first convert the image to either 8 bit grayscale or 24 bit color. Please refer to the ConvertColor method explanation in the ImageKit8 ActiveX Help File. | ||
5 | Q. When using the ActiveX control are the DLL files necessary? | N/A |
A. Yes, some of the ImageKit8 DLL files are absolutely necessary for your program to run. Others are necessary when using certain files or functions. For more details, please refer to the page in the ImageKit8 Help File Introduction section entitled, "Distributing Applications that use the ImageKit8 ActiveX". | ||
4 | Q. How can I retrieve the total number of images displayed in the Thumbnail Control. | N/A |
A. Refer to the ShowThumbImage event's MaxImage parameter. | ||
3 | Q. In the DLL Disp sample, when I use the File Open dialog and try to preview or load a vector image file, I get an error. What should I do? | N/A |
A. When previewing or loading a vector image file with the File Open dialog, you should first execute the IKVectGdipStart function (Ik8VectCom.dll). When finished, you should execute the IKVectGdipEnd function. Please add this code to the application. | ||
2 | Q. When I try to run one of the DLL sample programs I get an execution error. Why? | N/A |
A. You need to copy the ImageKit8 ActiveX DLL files into the same directory as the sample program or into a directory with a valid path. The ImageKit8 ActiveX DLL files can be found in the "ImageKit8\Product\System" folder under the directory where the ImageKit8 ActiveX was installed. | ||
1 | Q. Does the ImageKit8 ActiveX have a Slideshow control? | N/A |
A. No, the ImageKit8 ActiveX does not have the Slideshow control that was present in earlier versions of the ImageKit. |