
Prizm® IP FAQ |
![]() |
| This page contains frequently asked questions regarding using the Prizm IP control along with sample code.
|
| Q1 : How do I specify the image quality when saving an image as a JPEG with the Prizm Color IP C/C++ toolkit? |
| Q2: How can I deskew my images to a float value that I provide? |
| Q3: Why do I get an error when I try to save an image that I have opened and enhanced with the Prizm Color IP software? |
| Q4: I just installed the Prizm IP COM/ActiveX toolkit, and now I am having trouble loading VB6 projects. What can I do to resolve this problem? |
| Q5 : What suggestions can you offer for migrating from the ScanFix software to the Prizm Color IP C++ toolkit? |
| Q6: What DLL's do I need to distribute with my application? |
Q1 : How do I specify the image quality when saving an image as a JPEG with the Prizm Color IP C/C++ toolkit? |
| To specify image quality when saving a JPEG, you need to set PIConstJPEGCompressionQuality in the header item list. The values range from 0 to 100, 0 being lowest quality highest compression, 100 being highest quality, lowest compression. PIConstJPEGCompressionQuality is a secondary ID of a JPEG ID tag. See the example below. void EngineWrapper::WriteJPEG(const char *filename, long quality) { try { PIFileDisk fd; PIOpenFile of; PIHeaderManager hm; PIHeaderItemList list; PIHeaderItem item; item.SetPrimaryID(PIIDHeaderType); item.SetLongValue(PIConstHeaderTypeJPEG); list.AddNewItem(item); item.SetPrimaryID(PIIDJPEG); item.SetSecondaryID(PIConstJPEGCompressionQuality); item.SetLongValue(quality); list.AddNewItem(item); fd.SetFilename((LPCSTR)filename); of.Open(fd, true, true); hm.WriteImage(of, list, m_image, false, true); } catch(PIException &e) { CString s; s.Format("Exeption %i, <%s> occurred at %s:%i.", e.GetErrorNumber(), e.GetErrorString(), e.GetFilename(), e.GetLine()); AfxMessageBox(s); } } |
Q2: How can I deskew my images to a float value that I provide? |
| To deskew to a float value, use the PIImage::RotateImage() function. If the float value is a rise over run rather than an angle in degrees, then rotate by the arctangent of (rise/run). |
Q3: Why do I get an error when I try to save an image that I have opened and enhanced with the Prizm Color IP software? |
| This is often due to an attempt to save using a compression type that is not supported. For example, the Prizm Color IP software can load a number of image file types that it cannot write, such as TIFF/LZW. For a list of image file types and compressions that the Prizm Color IP software supports for loading and saving, please see the documentation. One method for handling a save operation would be to do the following: For the C/C++ toolkit: void WriteImage(PIOpenFile &OpenFile, PIHeaderItemList &items, PIImage &image, bool bAppend, bool bSupplyDefault = false); Setting bSupplyDefault to true will allow the Prizm Color IP software to choose a file/compression combination that can be saved. For the COM/ActiveX toolkit: Image.Save(filename, headertype, compressionmethod, appendtoend) Setting compressionmethod to piCompressionMethodDefault will allow the Prizm Color IP software to choose a file/compression combination that can be saved. For either toolkit, it may be useful to execute a try/catch logic, where the error is caught when trying to save the image without a default, and then make a choice about saving with the default afterward. For example, if the image fails being saved as TIFF with LZW compression, you could inform the user that that option is not available and offer to save with the default compression, or some other compression, and attempt the save again. |
Q4: I just installed the Prizm IP COM/ActiveX toolkit, and now I am having trouble loading VB6 projects. What can I do to resolve this problem? |
| To resolve this problem, delete PrizmIP.oca from C:\Program Files\Microsoft Visual Studio\VB98 and from the project's source folder. |
Q5 : What suggestions can you offer for migrating from the ScanFix software to the Prizm Color IP C++ toolkit? |
| The ScanFix image I/O has been replaced by native Prizm IP image I/O, and that will be the biggest challenge when migrating. Settings in current use can be saved to an INI file, and then loaded by the new code, or a mapping between an old ScanFix control structure and the new ScanFix object properties can be developed. It is recommended that you use native Prizm IP bitonal enhancements when possible. Here is some additional information you may find helpful. Functionality that has not changed: 1) The ScanFix core enhancement algorithms remain. These are the same algorithms used in the latest version of the ScanFix 4.5x toolkit. 2) INI file support remains. The ScanFix object will read and write ScanFix toolkit and application compatible INI files. Functionality that has changed: 1) String options are gone. Users of pre-4.5 ScanFix toolkits will find that string options are replaced by properties that represent the commonly used string options. 2) Autorotate has been removed. The ScanFix autorotate algorithm was at best only moderately reliable, and it has been replaced by the new Prizm IP OCR based rotation detection functionality. 3) File I/O is gone. The ScanFix object uses Prizm IP image objects, and Prizm IP I/O functions are used with those objects. 4) The message function is gone. Processing messages are now stored in a string and can be retrieved after processing. |
Q6: What DLL's do I need to distribute with my application? |
| For the Prizm IP C++ toolkit: PrizmImaging.dll For the Prizm IP COM/ActiveX toolkit: PrizmIP.dll PrizmIP.dll is a COM DLL and must be registered after it is installed. |