Image processing made easy!

ImageKit5: Frequently Asked Questions

Below are a few of the most frequently asked questions by users of the ImageKit5.

No. Question
  Answer
17 Q. When I use the ImageKit5 File sample program (in VB6) and save an image as uncompressed TIFF, the file size is larger than it should be and the file cannot be opened in Adobe Acrobat. Why?
  A. There is a mistake in our File sample program. In form 3 where you choose the file format in which to save the image, there is a drop down menu where you can select RGB color or CMYK color. We had the values reversed so that RGB color saved the file in CMYK color. This is the reason the file size increased. Instead of only three color planes (RGB) the image was saved in four color planes (CMYK). Adobe Acrobat can only read RGB color and that is why it could not load the file. Please reverse the values in the sample as shown in the code below:

'******* ImageKit5 File Sample (VB6) Form 3 *******
' TIFF DUMP
If Option7.Value = True Then
Form1.Ik5File1.Action = 13
Form1.Ik5File1.TiffColorSpace = 0
'If Combo2.Text = "RGB" Then This line is a mistake
If Combo2.Text = "CMYK" Then
Form1.Ik5File1.TiffColorSpace = 1
End If
End If
'********************************************
16 Q. In VisualBasic, there are problems drawing text using the DLL functions IK5DrawText and IK5TextOut(A).
  A. In the IK5PRINT_DATA, IK5PRINT_DATA_A, please add Chr$(0) to the end of FontName and Text. For Example:

Dim PrintData As IK5PRINT_DATA
PrintData.FontName = "Arial" & Chr$(0)
15 Q. When using a scanner or digital camera's TWAIN device to retrieve and image (with the manufacturer's user interface displayed), if I close the application before closing the user interface then the TWAIN device hangs up or doesn't run properly.
  A. If the application is shut down before the ScanExec method (for DLL, IK5ScanExec) finishes, the TWAIN will be unable to complete its necessary functions and hangs up. Please write the necessary code to that prevents the application from shuting down before the ScanExec method is finished executing.
14 Q. How can you print using Visual Basic's Printer object?
  A. To print output using the VB Printer object, you must notify the print object of the printing status before executing the ImageKit5 method (or function). See below.

ActiveX:
Ik5Print1.SetDeviceMode(1) ' sets the device mode to printer (0.1mm units)
Printer.Print " " 'notifies VB that we want to print.
Ret = Ik5Print1.ImageOut(Printer.hDC, ImgHandle, 100, 100, 1000, 1000, False)
Printer.NewPage
Printer.EndDoc

DLL:
IK5SetDeviceMode(1) ' sets the device mode to printer (0.1mm units)
Printer.Print " " 'notifies VB that we want to print.
Ret = IK5ImageOut(Printer.hDC, ImgHandle, Rect, False)
Printer.NewPage
Printer.EndDoc
13 Q. I have used the ImageKit5 to make an application. Now, I want to install that application into another PC using an install program but the ImgKit5.ocx will not register.
  A. You not only need to copy the ImgKit5.ocx and register it, but you must also copy the necessary dll files along with the ImgKit5.ocx. For a list of the dependent dlls, please refer to the programming manual in the section entitled, "Distributing Applications. Once all the dependent files have been copied, you should have no problems registering the ImgKit5.ocx.
12 Q. In ActiveX, I want to directly load an image file without using the File Open dialog.
  A. First, set the image's path and file name into the File Control's FileName property. Then set the appropriate value in the File Control's Action property and run the Execute method.
11 Q. I want to be able to retrieve and pass an image between the ImageKit5 image handle and the TBitmap in Delphi or C++Builder. Is this possible?
  A.
To move an image from the ImageKit5 to TBitmap:
1. Use the clipboard.
2. Use the Print Control's ImageOut method (For DLL, IK5ImageOut) to draw the image to the TBitmap canvas.
3. Pass the image to a BMP file or other format that the TBitmap can read.

To move an image from TBitmap to the ImageKit5.
1. Use the clipboard
2. Use the Print Control's GetImageFromHdc method (For DLL, IK5GetImageFromHdc)
3. Using Delphi's or C++Builder's GetDIBSizes and GetDIB, create a DIB that the ImageKit5 can use.
4. Save the image into a format that the ImageKit5 can read.
10 Q. I would like to retrieve the paper size and print orientation from the printer file set by the Print Control's SetPrint method or the DLL's IK5SetPrint function.
  A. Since there is no function for retrieving this information directly from the printer file, please use the return value of the PrintStartDoc method or the IK5PrintStartDoc function and execute the GetPaperSize method or the IK5GetPaperSize function.
9 Q. Does the ImageKit5 support TIFF's MH, MR, or MRR file formats?
  A. Yes, MH is TIFF Group3-1D, MR is TIFF Group3-2D, and MRR is TIFF Group4.
8 Q. I would like to draw text or diagrams on images displayed in the Display Control.
  A. There are two ways to draw text or diagrams on images displayed in the Display Control.
1. Initialize the Display Control with Action = 3. Using one of the Print Control's drawing methods, draw in the HdcMemory. Execute the Modify method in order to pass the drawing to the ImgHandle.
2. Initialize the Display Control with Action = 1. Using one of the Print Control's drawing methods, draw in the Hdc. When drawing in the Hdc, text or diagrams are overwritten when the image is refreshed (this includes scrolling) and therefore it is necessary to redraw the text or diagram each time the image is refreshed.
7 Q. I would like to use the current printer without displaying the printer selection dialog.
  A. Please download the 05/15/2000 updated module from our website.
1. For ActiveX, set the PrintFileName property to default before executing the PrintStartDoc method.
2. For DLL, set the PrintFileName argument of the IK5PrintStartDoc to default.
6 Q. Why do I have trouble processing the image memory handle retrieved from a TWAIN scan device?
  A. After the TWAIN device scans each image and the after scan event (ActiveX) or user function (DLL) is processed, the internal memory handle of the scanned image is deleted. In order to use the scanned image, it is first necessary to save the image file or create a copy of the image within the after scan event or user function.
5 Q. In the Slideshow Control, after I make changes to a set folder or make changes to a slide file and start to redisplay it, I have problems doing so. Why?
  A.To make changes to a folder or slide file, you must first execute the Close method and then after that set the folder or slidefile and execute the Open method.
4 Q. I am having problems controlling the pan window in the Display Control. Why?
  A. Arrange the forms in the Display Control as modeless as opposed to modal.
3 Q. I want to display black and white image data in grayscale like Windows Imaging. (When compressing large images).
  A. In ConvertColor change the PixelType to 80 for grayscale. Resize the image and compress. Retrieve the image and it can be displayed.
2 Q. How can I save the portion of the image that is in the selected area?
  A. To select a portion of an image, use the Effect Control's SelectImage method. The result is in the OutImgHandle property. Send the result to the File Control's ImgHandle property and save the file. For Dll, use the IK5SelectImage(Ex) to select the appropriate area on the image. Retrieve the image handle (hImgBmh) and save it in a file.
1 Q. After loading a BMP file,I am not able to save it in JPEG format. Why?
  A. Only 8 bit grayscale and 24 bit color images can be saved in a JPEG file. For other images, you must first convert the number of colors before saving the image in a JPEG file. For details please refer to the ImageKit5 manual or help file.