ScanFix® Xpress v5.1 FAQ

Contact Support



Q1How can I determine if I have the latest version of a Pegasus control?
Q2What DLL's do I need to distribute with my application?
Q3How do I distribute my application (in .NET, Delphi, VB, C++ etc.)?
Q4How do I pass an image into the ScanFix control to perform image processing on it and retrieve the resulting image?
Q5I am using the ImagXpress 8 .NET control. How do I load the image data into the ScanFix control?

Q1: How can I determine if I have the latest version of a Pegasus control?
Please download the PegConnect utility program from the following link: PegConnect
or reference the Latest Builds page.

Q2: What DLL's do I need to distribute with my application?
For .NET Windows Forms Applications:
PegasusImaging.WinForms.ScanFix5.dll - ScanFix .NET Windows Forms Control

For All Other Applications:
PegasusImaging.ActiveX.ScanFix5.dll - ActiveX Control

If you are using the ScanFix ActiveX component, it needs to be registered after it is installed. Make sure that your installation program registers the ScanFix COM component before you run your application.

Q3: How do I distribute my application (in .NET, Delphi, VB, C++ etc.)?
PLEASE NOTE: You must have received unlock codes in order to distribute applications. These are received when the runtimes are purchased. If you have not received them please Contact Sales.

1) Add a declaration to the UnlockRuntime method where your program starts up and pass the 4 unlock codes as the parameters to the method.

2) If you are using .NET as your development tool you must do # 1 AND call the UnlockControl function and pass as the parameters the same 4 unlock codes that are passed as the parameters to the UnlockRuntime method as mentioned in #1. Please refer to the code samples below for the specific .NET development environments:

For C# Developers:
Call the static UnlockControl function in the class constructor BEFORE the generated call to InitializeComponent() as follows:

Public FormMain()
{
PegasusImaging.WinForms.ScanFix5.License.UnlockControl(1234,1234,1234,1234);
InitializeComponent();
}

For Visual Basic. NET Developers:
Call the static UnlockControl function in the class constructor (i.e. New function) BEFORE the generated call to InitializeComponent() as follows:

Public Sub New ()
MyBase.New)

PegasusImaging.WinForms.ScanFix5.License.UnlockControl(1234,1234,1234,1234)
IntializeComponent()
End Sub

3) If you are using the ScanFix control as a COM object in VB you must do#1 AND declare the UnlockControl function as outlined below:

a) Add a reference to the ScanFix control via Project|References.

b) Declare the UnlockControl function as follows:

Private Declare Sub BC_UnlockControl Lib " PegasusImaging.ActiveX.ScanFix5.dll" Alias "UnlockControl" (ByVal pw1 As Long, ByVal pw2 As Long, ByVal pw3 As Long, ByVal pw4 As Long)

c) Dim the ScanFix control object:

Dim sf As PegasusImagingActiveXScanFix5Lib.ScanFix

d) Call the UnlockControl method:

SF_UnlockControl 12345, 12345, 12345, 12345

Set sf = New PegasusImagingActiveXScanFix5Lib.ScanFix

4) If you are using the control within HTML you must obtain a web license string. This web license string is received from our sales department when the web license is purchased. The web license string is passed as the parameter to the UnlockWeb method. Please refer to http://www.pegasusimaging.com/weblicfaq.htm for more information on using the control within a web environment.

5) If you are using the ScanFix ActiveX control open your project with your development tool (Visual Basic or Delphi) and rebuild the EXE. The new registration information will be automatically incorporated in the new executable.

If the ScanFix 5 ActiveX control is used in an environment that supports persistence (ie. VB), the user is still required to call the UnlockRuntime method before using it. If in fact the exe is built on a machine where ScanFix is registered, and a valid ScanFix license is persisted, only the UnlockRuntime call is required, and the UnlockControl call is not needed.

6) If you are using the ScanFix COM control in C++ you must do #1 and edit the lpfnDllFunc1 function in the SF5_open.cpp file by adding the 4 unlock codes. The C++ project then just needs to be rebuilt.

Q4: How do I pass an image into the ScanFix control to perform image processing on it and retrieve the resulting image?
Note: Some of the sample code below uses the ImagXpress control to load the image data.

VB 6 demonstrating FromHDib and ToHdib methods:

Xpress.FileName = "C:\benefits.tif"
sf.FromHdib Xpress.CopyDIB
sf.Flip
Xpress.hDIB = (sf.ToHdib(True))

VB.NET demonstrating FromHDib and ToHdib methods:

PicImagXpress1.FileName = "C:\benefits.tif"
sf.FromHdib(New System.IntPtr(PicImagXpress1.CopyDIB))
sf.Flip()
PicImagXpress1.hDIB = sf.ToHdib(True).ToInt32()

VB.NET demonstrating FromBitmap and ToBitmap methods:

Dim pic As New System.Drawing.Bitmap("C:\benefits.tif")
sf.FromBitmap(pic)
sf.Flip()
pic = sf.ToBitmap()
pic.Save("C:\\test.bmp", System.Drawing.Imaging.ImageFormat.Tiff)

C# demonstrating FromHDib and ToHdib methods:

picImagXpress1.FileName = "C:\\benefits.tif";
sf.FromHdib( ( System.IntPtr ) picImagXpress1.CopyDIB() );
sf.Flip();
picImagXpress1.hDIB = ( int )sf.ToHdib( true);

C# demonstrating FromBitmap and ToBitmap methods:

sf.FromBitmap(pic);
sf.Flip();
pic = sf.ToBitmap();
pic.Save("C:\\test.bmp",System.Drawing.Imaging.ImageFormat.Tiff);

Delphi code demonstrating FromHBitmap and ToPicture methods:

Bitmap2 : TBitmap;
pic : IPictureDisp;
temp : TPicture;

begin
  BitMap2 := TBitMap.Create;
  temp := TPicture.Create;

  BitMap2.LoadFromFile('C:\\bene.bmp');
  sf.FromHbitmap(Bitmap2.Handle);
  sf.Flip;
  pic := sf.ToPicture();
  SetOlePicture(temp,pic);
  Image1.Picture := temp;
end;

Delphi code demonstrating FromHDib and ToHDib methods:

Xpress.FileName := 'C:\benefits.tif';
sf.FromHdib(xpress.CopyDIB);
sf.Flip;
Xpress.hDIB := sf.ToHdib(true);

Q5: I am using the ImagXpress 8 .NET control. How do I load the image data into the ScanFix control?
To copy an image from the ImagXpress 8 .NET control, you can use the ToHdib method of the ImageX class as outlined in the code samples below. The sample code assumes the image data is in 1 bit per pixel format.

For C# Developers:
PegasusImaging.WinForms.ImagXpress8.ImagXpress ix = new PegasusImaging.WinForms.ImagXpress8.ImagXpress();
PegasusImaging.WinForms.ImagXpress8.ImageX theImageX = PegasusImaging.WinForms.ImagXpress8.ImageX.FromFile("c:\\Pegasus.tif");
scanFix1.FromHdib((System.IntPtr) theImageX.ToHdib(false));

For Visual Basic. NET Developers:
Dim ix As New PegasusImaging.WinForms.ImagXpress8.ImagXpress()
Dim theImageX As PegasusImaging.WinForms.ImagXpress8.ImageX
theImageX = PegasusImaging.WinForms.ImagXpress8.ImageX.FromFile("c:\Pegasus.tif")
ScanFix1.FromHdib(theImageX.ToHdib(False))


Sitemap | © 2008 Pegasus Imaging Corporation. All Rights Reserved. | Privacy Statement.