LEADTOOLS Support
Imaging
Imaging SDK Questions
Load and Display TIF in Raster Image Viewer
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, December 22, 2008 4:49:11 AM(UTC)
Groups: Registered
Posts: 3
I am getting an error of INVALID FILE FORMAT when trying to load a TIF image into the rasterimageviewer.
I downloaded the evaluation copy of LeadTools .NET 32-bit eval 16. I am mostly interested in the funtionality of zooming in and out. I am running WinXp, VS 2005 SP1, & Framework 2.0.50727 SP1.
Here are the steps I did:
- Created a blank C# Windows Application Solution with VS 2005
- Right click on the toolbox and clicked on Choose Item...
- Added the RasterImageViewer and RasterPictureBox Controls
- Dragged a RasterImageViewer onto the Form
- Leadtools, Leadtools.Codecs, and Leadtools.WinForms were added to the Reference
- The code below is what I am running for this simple test
- The invalid format error happens when I do the codecs.load(FILENAME)
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Text;
using
System.Windows.Forms;
using
Leadtools.Codecs;
namespace
LeadToolTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
RasterCodecs.Startup();
RasterCodecs codecs = new RasterCodecs();
rasterImageViewer1.Image = codecs.Load(
@"S:\VS2005Code\LeadToolTest\LeadToolTest\LeadToolTest\test.tif");
codecs.Dispose();
RasterCodecs.Shutdown();
}
}
}
#2
Posted
:
Monday, December 22, 2008 5:43:35 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You will also need to include the file format DLL. For example if you want to support JPG, you need to include Leadtools.Codecs.Cmp.dll. If you want to support TIFF CCITTG4 format, you need to add Leadtools.Codecs.Fax.dll and Leadtools.Codecs.Tif.dll to your project.
For more information, please check the help file 'Files To Be Included With Your Application'.
#3
Posted
:
Tuesday, December 23, 2008 4:41:06 AM(UTC)
Groups: Registered
Posts: 3
Adding the codec for the type of image file fixed the issue.
Thanks.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Load and Display TIF in Raster Image Viewer
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.