Image processing made easy!

ImageKit7 ActiveX: Frequently Asked Questions

Below are a few of the most frequently asked questions by users of the ImageKit7 ActiveX. Click on the question number to jump to the answer.

No. Question Date
33 Q. Can the ImageKit7 be used in 64 bit operating systems? 2010/03/05
32 Q. There are Tiff(Jpeg compression) images that the ImageKit7 can load and other Tiff(Jpeg compression) images that it cannot load. What is the difference between these images? 2009/06/12
31 Q. How can I "mirror" or "flip" an image? 2009/02/24
30 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? 2008/10/15
29 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? 2008/8/28
28 Q. Using a custom-built scan interface (Scan.UIMode=2), how can I scan multiple areas on the same paper? 2008/7/16
27 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? 2008/7/16
26 Q. When I draw text, etc., on a raster image that is in an image layer, the text or other drawing is not displayed in the ImageKit control. Why? 2008/7/16
25 Q. I have built a custom scan interface and want to only scan a portion of a document. How can I do that ? 2008/2/20
24 Q. I am using the ImageKit7 in a web application and when the CAB file is downloaded from the server to the client PC, Internet Explorer crashes. Hey, what gives!? 2007/10/12
23 Q. Does the ImageKit7 support SVG compressed image format? 2007/07/25
22 Q. I want to delete a specific page in a multipage file. How can I do that? 2007/06/22
21 Q. What is the version of SXF that is supported by the ImageKit7 ActiveX? 2007/04/05
20 Q. In the image-editing toolbar, there is an "Undo" command. Is it possible to also do a "Redo"? 2007/04/05
19 Q. Is it possible to use code to command the image-editing toolbar's popup window? 2007/04/05
18 Q. Is it possible to edit a vector image without using the image-editing toolbar? 2007/04/05
17 Q. In Visual C++ how can I change the size of the control at runtime? 2007/03/30
16 Q. How can I create a multipage tiff file? N/A
15 Q. What determines the size of a thumbnail image in the Thumbnail Control? N/A
14 Q. How can I convert the height of an image given in pixels to inches or centimeters? N/A
13 Q. How can I enable the "Page" settings in the Print dialog when it first appears? N/A
12 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
11 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
10 Q. I am using an earlier release of WindowsXP and I cannot properly load, save, draw to, or print vector images. What is going on? N/A
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
8 Q. How can I print without displaying the Select Printer common dialog? N/A
7 Q. I want to print an image so that it fills the printable area for a given paper size. N/A
6 Q. In the Visual C++ 6 ActiveX sample program, I am loading an image but it is not displayed. Why? N/A
5  Q. I am having problems saving an image in JPEG file format. N/A
4 Q. When using the ActiveX control are the DLL files necessary? N/A
3 Q. How can I retrieve the total number of images displayed in the Thumbnail Control. N/A
2 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
1 Q. When I try to run one of the DLL sample programs I get an execution error. Why? N/A

 

No. Question Date
  Answer  
33 Q. Can the ImageKit7 be used in 64 bit operating systems? 2010/03/105
  A. Yes, but only as 32 bit applications. When creating applications in VS2005 or in VS2008, be sure to set the target platform for the build to [x86] and not to [AnyCPU] or [x64].  
32 Q. There are Tiff(Jpeg compression) images that the ImageKit7 can load and other Tiff(Jpeg compression) images that it cannot load. What is the difference between these images? 2009/06/12
  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.  
31 Q. How can I "mirror" or "flip" an image? 2009/02/24
  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.  
30 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? 2008/10/15
  A. You need to also deploy the stdole.dll (Primary Interop Assembly) with your application.  
29 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? 2008/8/28
  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 ImageKit7 DLL version, there is no Editing mode so there is no way to shorten the drawing time.
 
28 Q. Using a custom-built scan interface (Scan.UIMode=2), how can I scan multiple areas on the same paper? 2008/7/16
  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", "ImageKit7 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
 
27 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? 2008/7/16
  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.
 
26 Q. When I draw text, etc., on a raster image that is in an image layer, the text or other drawing is not displayed in the ImageKit control. Why? 2008/7/16
  A. When raster images are set in the Layer interface's image layers, information about transparency for each layer is passed to the ImageKit control. For this reason, if you draw to the image data for a particular Layer[0].ImageHandle, the text does not appear in the ImageKit control, even though the underlying image data has changed. To force the ImageKit control to redraw the image, set the Layer Transparent property to False and then draw to the image or pass the image handle into a variable, draw to that image, then pass that image handle back into the ImageHandle property.

For example:

In Visual Basic
(1)Setting the Transparent property to False:
Dim Ret As Boolean

'After the Layer image has been set.....

'temporarily change Transparent to False
ImageKit1.Layer(0).Transparent = 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 = "Text"
Ret = ImageKit1.PrintDraw.TextOut(ImageKit1.Layer(0).ImageHandle, 20, 20, ikMemoryHandle)

'Reset transparency to True
ImageKit1.Layer(0).Transparent = True
ImageKit1.Refresh

(2)Passing the image into a variable:
Dim StoredImageHandle As Long
Dim Ret As Boolean

'The Layer image has already been set.....

'Pass loaded image into variable
StoredImageHandle = ImageKit1.Layer(0).ImageHandle

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 = "Text"
Ret = ImageKit1.PrintDraw.TextOut(ImageHandle, 20, 20, ikMemoryHandle)

'Pass modified image back into ImageHandle property
ImageKit1.Layer(0).ImageHandle = StoredImageHandle
ImageKit1.Refresh
 
25 Q. I have built a custom scan interface and want scan to only a portion of a document. How can I do that ? 2008/2/20
  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 ImageKit7 DLL version, use the IKScanGetCapEnum function).
 
24 Q. I am using the ImageKit7 in a web application and when the CAB file is downloaded from the server to the client PC, Internet Explorer crashes. Hey, what gives!? 2007/10/12
  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 ImageKit7 support SVG compressed image format? 2007/07/25
  A. No The ImageKit7 only supports uncompressed SVG. SVGZ is not supported.  
22 Q. I want to delete a specific page in a multipage file. How can I do that? 2007/07/25
  A. There is no direct function in the ImageKit7 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. What is the version of SXF that is supported by the ImageKit7 ActiveX? 2007/04/05
  A. The ImageKit7 ActiveX supports version 3 level 2. However, there are some items, hatching for example, that are not supported.  
20 Q. In the image-editing toolbar, there is an "Undo" command. Is it possible to also do a "Redo"? 2007/04/05
  A. No, a "Redo" is not possible.  
19 Q. Is it possible to use code to command the image-editing toolbar's popup window? 2007/04/05
  A. No, it is not possible. Unfortunately, the commands used for the popup menu are not public so those commands cannot be accessed directly via code.  
18 Q. Is it possible to edit a vector image without using the image-editing toolbar? 2007/04/05
  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? 2007/03/30
  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. 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
 
15 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.  
14 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
 
13 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.
 
12 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.  
11 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 ImageKit7 DLL files, i.e. Ik7***.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.  
10 Q. I am using an earlier release of WindowsXP and I cannot properly load, save, draw to, or print vector images. What is going on? N/A
  A. If the gdiplus.dll is not in the Windows System folder or is not in a folder in a valid path, or is not in the same folder as the executable file (exe), then vector images cannot be processed correctly. Please make sure that the gdiplus.dll is contained in one of the above folders.  
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. In the Visual C++ 6 ActiveX sample program, I am loading an image but it is not displayed. Why? N/A
  A. Do the following things in order:

1. Within your program please delete the following files.

edit.cpp,edit.h
effect.cpp,effect.h
exif.cpp,exif.h
file.cpp,file.h
imagekit.cpp,imagekit.h
layer.cpp,layer.h
magnifier.cpp,magnifier.h
panwindow.cpp,panwindow.h
picture.cpp,picture.h
printdraw.cpp,printdraw.h
scan.cpp,scan.h
vector.cpp,vector.h


2. In Visual C++6, click the "Project" menu, then "Add to Project", "Component or Control". From the "Component or Control Gallery", choose "Registered ActiveX Controls". Finally, select "ImageKit7 ActiveX Control".

3. Rebuild project.
 
5 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 in the ImageKit7 ActiveX Help File.  
4 Q. When using the ActiveX control are the DLL files necessary? N/A
  A. Yes, some of the ImageKit7 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 ImageKit7 Help File Introduction section entitled, "Distributing Applications that use the ImageKit7 ActiveX".  
3 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.  
2 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 (Ik7VectCom.dll). When finished, you should execute the IKVectGdipEnd function. Please add this code.  
1 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 ImageKit7 ActiveX DLL files into the same directory as the sample program or into a directory with a valid path. The ImageKit7 ActiveX DLL files can be found in the "ImageKit7\Product\System" folder under the directory where the ImageKit7 ActiveX was installed.