Imaging software


Frequent Asked Questions

General
Do I have to pay royalties
What are the license terms
What may I distribute
Does the toolkits work with a Delphi and C++Builder demo version
Installation
In which directories did the toolkit install to
Delphi/C++Builder cannot find the components files
The MCM DESIGN components are not in the Component palette
Compiler Errors
Compiler cannot find file
[Fatal Error] filename.pas(nnn): Unit A_Unit was compiled with a different version of Another_Unit
TWAIN, How do I ...
Acquire to file
My program does not close down after applying the TmcmTWAIN component
Floating Point Exceptions in certain TWAIN drivers
Imaging, How do I ...
Assign an image from a TBitmap/TImage to a TmcmImage
Assign an image from a TmcmImage to a TBitmap/TImage
Rotate an image in a TBitmap/TImage
I could not find the answer
If you cannot find the answer to you question in the list below - then forward your question to:
MCM DESIGN
Tamsborgvej 56
DK-3400 Hillerød
Denmark
CustomerCare@mcm-design.dk
Please, add the product name in the e-mail subject.

General


Question:
Do I have to pay royalties

Answer:
No, all the developer toolkits provided by MCM DESIGN are royalty free. You only pay a license fee per developer using the toolkit.
Question:
What are the license terms

Answer:
This is the license agreement included in the developer toolkit's On-line help.

Warranties
This software is provided "AS IS" and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.

Grant of license
MCM DESIGN grants you the right to use one copy of the enclosed MCM DESIGN software program on a single computer.
The software is in use when it is loaded into temporary memory, i.e. RAM, or installed into permanent memory, e.g. hard disk, CD ROM or other storage device, of that computer.

However, installation on a network server for the sole purpose of distribution to one or more computer(s) shall not constitute use for which a separate license is required.

Copyright
The software is owned by MCM DESIGN and is protected by Danish copyright laws, international treaty provisions, and all other applicable laws.
Therefore, you must treat the software like any other copyright material except that if the software is not copy protected you may either make a copy of the software solely for backup or archival purpose, or transfer the software to a single hard disk provided you keep the original solely for backup or archival purpose. You may not copy the product manual(s) or written material accompanying the software.

Other restrictions
You may not rent or lease the software, but you may transfer your rights under this MCM DESIGN license agreement on a permanent basis provided you transfer all copies of the software and all written materials, and the recipient agrees to the terms of this agreement. Any transfer must include the most recent update and all prior versions.
You may not reverse engineer, de-compile or disassemble the software.
The software may not be published or distributed in any way, without the written permission by the author. Nor may you distribute any of the components, component(s) inherited from or based on this software.

The toolkit may be used upon registering, for the sole purpose of including the functionality available in the toolkit in your compiled program.
Question:
What may I distribute

Answer:
You may distribute your compiled end-user program, i.e. binary executables, freely and in any number you see fit.
The toolkit in full or in part may not be published or distributed. Nor may you distribute any of the components source code or VCL's or written material, component(s) inherited from or based on this software.
Question:
Does the toolkits work with a Delphi and C++Builder demo version

Answer:
Delphi and C++Builder demo versions does not allow using third party components. Therefore, non of the toolkits will work if the installed Delphi or C++Builder is a demo version.

Installation


Question:
In which directories did the toolkit install to

Answer:
The Imaging Toolkit for Delphi is installed into the following directories:

Sample projects: d:\Program Files\Borland\Delphi(x)\Projects\
Components: d:\Program Files\Borland\Delphi(x)\MCM DESIGN\
Online Help: d:\Program Files\Borland\Delphi(x)\Help\
Compiled sample project: d:\Program Files\MCM DESIGN\

The TWAIN Toolkit for Delphi is installed into the following directories:

Sample projects: d:\Program Files\Borland\Delphi(x)\MCM DESIGN\
Components: d:\Program Files\Borland\Delphi(x)\MCM DESIGN\
Online Help: d:\Program Files\Borland\Delphi(x)\Help\
Compiled sample project: d:\Program Files\MCM DESIGN\

The TWAIN Toolkit for C++Builder is installed into the following directories:

Sample projects: d:\Program Files\Borland\CBuilder(x)\MCM DESIGN\
Components: d:\Program Files\Borland\CBuilder(x)\MCM DESIGN\
Online Help: d:\Program Files\Borland\CBuilder(x)\Help\
Compiled sample project: d:\Program Files\MCM DESIGN\
Note, (x) denotes the version of Delphi or C++Builder.
Problem:
Delphi/C++Builder cannot find the components files.

Error message:
Can't load package "Some-package". The specified module could not be found.

Solution:
Add the component path to the system variable "Path".
Run Delphi or C++Builder, click the menu "Tools, Environment Options...". In the "Environment Options" dialogue select the "Environment Variables" page.
Locate and select the "Path" variable in the "System Variables" list. Click the "Add Override..." button. In the "Override System Variable" dialogue "Path" is typed in the "Variable name" edit-box. Now append ";$(DELPHI)\MCM DESIGN" to the existing string in the "Variable Value" edit-box.
If you already have a User Variable named Path listed in the "Users Overrides" list, select this entry and click the "Edit" button instead, and append ";$(DELPHI)\MCM DESIGN" to the existing "Variable Value" string.

When you have added the component path to the system variable "Path" you should re-enable or add the components.
Problem:
The MCM DESIGN components are not in the Component palette.

Solution:
Manually add components to the Component palette
First select the menu "Components, Installed packages...". If the following packages
MCM DESIGN, Int and Real Spin Control
MCM DEISGN, TWAIN Toolkit for Delphi
MCM DEISGN, Imaging Toolkit for Delphi
are listed but not checked, check these.
If you cannot find these entries in the "Design packages" list, add the following files one by one and in the order listed below

Delphi3
mcmInt(X).dpl
mcmTwn(X).dpl
mcmImaging(X).dpl

Delphi4-7
mcmInt(X).bpl
mcmTwn(X).bpl
mcmImaging(X).bpl

C++Builder 3-6
mcmIntCB(X).bpl
mcmTwnCB(X).bpl

Note, (X) denotes the version of Delphi or C++Builder.
To add a component file click the "Add..." button and navigate to the MCM DESIGN directory:
d:\Program Files\Borland\Delphi(X)\MCM DESIGN
locate and select the ".bpl" file and click "Open".

Compiler Errors


Problem:
You get a compiler error that states that a file belonging to the toolkit cannot be found.

Solution:
Run Delphi or C++Builder, click the menu "Tools, Environment Options...". In the "Environment Options" dialogue select the "Library" page.
Click the Ellipse ("...") button to the right of "Library Path" and add/append "$(DELPHI)\MCM DESIGN".
Problem:
A file was compiled with a different version.

Error message:
[Fatal Error] filename.pas(nnn): Unit A_Unit was compiled with a different version of Another_Unit

Solution:
You have multiple files with the same file-name, and you must delete or rename the file(s) that do not belong to our toolkit.
Most often the error occurs because you have installed our TWAIN or Imaging toolkit and another toolkit which both contains the TWAIN.PAS or TWAIN.DCU file, and Delphi is including the incorrect file when compiling.

TWAIN, How do I ...


Problem:
Acquire an image to file.

Solution:
First, set the property XferMech to TWFX_FILE, assign your preferred file format to the property FileFormat (for example TWFF_JFIF or TWFF_TIFF), and enable additional formats supported by your application in the property FileFormats. The FileFormats property could be thought of as your second choice.
Second, before you call either the Acquire or EnableSource method, assign the full path to the FileName property, i.e. disk driver + directories + file name and extension. The driver and directory in this path must be valid!

When the TWAIN driver is opened, i.e. loaded into memory when Acquire or OpenSource is called, the TmcmTWAIN or ActiveTWAIN component will negotiate the requested FileFormat with the TWAIN driver. If the TWAIN driver doesn't support this format, the TmcmTWAIN or ActiveTWAIN component starts negotiating the formats enabled in FileFormats.
Now, if the TWAIN driver doesn't support any of these formats the TmcmTWAIN or ActiveTWAIN component will automatically switch to the Native transfer mechanism, where the image is returned in a memory handle.
If either of the specified formats is successfully negotiated, the image will be save to file in that format.

If your scanner has an ADF, and you're acquiring more than one image per session, your must change the file name in the OnXferNext event to avoid overriding the previous image.

It should be noted that the file formats specified in the TWAIN specifications are not mandatory. Therefore, there is no guaranty that the TWAIN driver will support any of the specified file formats, nor that two different TWAIN drivers will support the same file formats.

To ensure that the images are stored in the desired file format it is recommended that the image be transferred using the Native or Memory transfer mechanism to the TmcmImage or TmcmImageCtrl component, which can then save the image.
Alternative, if you're using Delphi or C++Builder, you can use the TImage component to store the images in either the Bitmap or JPEG format.

Note, the TmcmTWAIN and ActiveTWAIN components do not save the acquired image to file, but instead request that the TWAIN driver saves the image in the specified format.
Problem:
My program does not close down after applying the TmcmTWAIN component.

Solution:
This particular problem has been observed in Delphi 6, and is due to a synchronization call from the application (occuring inside the TmcmTWAIN) to the TmcmTWAIN component threads.

To resolve this problem you must obtain and apply service release 1 for Delphi 6 from Borland.

It is our recommendation that you apply all service packs available from Borland to your Delphi edition.
Problem:
Floating Point exceptions occurring in certain TWAIN drivers.

Solution:
To resolve this problem you should turn off Floating Point Exceptions in C++Builder and Delphi.

In C++Builder add the following line in your main form's OnCreate:
   _control87(MCW_EM, MCW_EM);
Similar in Delphi, add the following line in your main form's OnCreate:
   Set8087CW(DWord($133F));
This correction is implemented in the TWAIN Toolkit for Delphi version 3.0.4.

Imaging, How do I ...


Problem:
Assign an image from a TBitmap/TImage to a TmcmImage

Solution:
DibHandle is used to access or set the HBITMAP handle. TmcmImage takes ownership of a HBITMAP handle when this is assigned to DibHandle.

function BitmapToImage(Bitmap : TBitmap) : TmcmImage;
var Image : TmcmImage;
begin
  Image := TmcmImage.Create;
  // Image gets ownership of the HBITMAP handle.
  Image.DibHandle := Bitmap.ReleaseHandle;
  Result := Image;
end;
Problem:
Assign an image from a TmcmImage to a TBitmap/TImage

Solution:
Property DibHandle returns a HBITMAP handle owned by TmcmImage. Note, it does not return a copy of the handle. To transfer ownership of the HBITMAP handle use ReleaseHandle instead.

function ImageToBitmap(Image : TmcmImage) : TBitmap;
var Bitmap : TBitmap;
begin
  Bitmap := TBitmap.Create;
  // Bitmap gets ownership of the HBITMAP handle.
  Bitmap.Handle := Image.ReleaseHandle;
  Result := Bitmap;
end;
Problem:
Rotate an image in a TBitmap/TImage

Solution:
Generally, when you need to process an image, the handle (a HBITMAP) must reside in an instance of TmcmImage.
procedure TMainForm.RotateTImage(Source : TImage); 
var ImageTransform : TmcmImageTransform;
begin
  ImageTransform := TmcmImageTransform.Create(Self);
  ImageTransform.SourceImage[0] := TmcmImage.Create;
  ImageTransform.SourceImage[0].DibHandle := Source.ReleaseHandle;
  ImageTransform.Rotate(True, 45); // Rotate 45 degree
  // Return rotated image back to Source.
  Source.Handle := ImageTransform.ResultImage.ReleaseHandle;
  ImageTransform.SourceImage[0].Free;
  ImageTransform.ResultImage.Free;
  TmcmImageTransform.Free;
end;

MCM DESIGN · Tamsborgvej 56 · 3400 Hillerød · Denmark
Copyright © 1998-2015