472,986 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

Tiff images

what are options for opening / handling tiff files in .Net framework ?
which is the best library, namespace ?

Please help

Regards
Sameer Gupta
C# Designer & Developer
Siemens
UK
Sep 18 '06 #1
5 14879
Hello Sameer,

GDI+ saves u.
Look MSDN for this.

SSwhat are options for opening / handling tiff files in .Net framework
SS? which is the best library, namespace ?
SS>
SSPlease help
SS>
SSRegards
SSSameer Gupta
SSC# Designer & Developer
SSSiemens
SSUK
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 18 '06 #2
Thanks Michael.

GDI+ looks quite generic.

which is better for Tiff images - GDI+ or VintaSoft.Tiff (@
http://www.vintasoft.com/vstiff-dotnet-faq.html) ?

in terms of features & performance?

Please suggest.

Regards
Sameer Gupta
C# Designer & Developer
Siemens
UK

"Michael Nemtsev" wrote:
Hello Sameer,

GDI+ saves u.
Look MSDN for this.

SSwhat are options for opening / handling tiff files in .Net framework
SS? which is the best library, namespace ?
SS>
SSPlease help
SS>
SSRegards
SSSameer Gupta
SSC# Designer & Developer
SSSiemens
SSUK
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 18 '06 #3

Sameer Gupta wrote:
what are options for opening / handling tiff files in .Net framework ?
which is the best library, namespace ?
Well, what is "best" depends very much on what you want to do, and how
much control you want.

If you just want to display images, the Image / Bitmap classes are
probably the ones you want. Be forewarned, though, that
Image.FromFile() leaves the TIF file locked for a while... probably
until the garbage collector gets around to doing something with the
objects that FromFile was using to read the file.

I read the TIF file into a MemoryStream and then feed it to
Image.FromStream(), like this:

Image fullImage;
System.IO.Stream st = System.IO.File.Open(imageFilePath,
System.IO.FileMode.Open, System.IO.FileAccess.Read,
System.IO.FileShare.Read);
try
{
byte[] b = new byte[st.Length];
st.Read(b, 0, b.Length);
System.IO.MemoryStream ms = new System.IO.MemoryStream(b);
fullImage = Image.FromStream(ms);
}
finally
{
st.Close();
}

which ensures that the file lock is released as soon as possible.

Be also forewarned that the Image class limits your control over the
image format. There are a limited set of bit depths at your disposal,
for example, which can cause a lot of bloat in memory as tiny
black-and-white TIF images are blown out into (unnecessary) 8-bit or
16-bit colour in memory.

Nonetheless, if all you want to do is show pictures to your user, this
is no doubt the simplest way to do that.

Sep 18 '06 #4
Thanks very much Bruce.

Actually I have lot of Tiff files, many of them are corrupted.
I need to programmatically validate / check the existing tiff files whether
they are corrupt or not. a read only mode. also don't wanna lock files.

GDI + is an option. also there is VintaSoft.Tiff library for .Net.

Please help in finding an appropriate way.
Regards
Sameer Gupta
C# Designer & Developer
Siemens
UK
"Bruce Wood" wrote:
>
Sameer Gupta wrote:
what are options for opening / handling tiff files in .Net framework ?
which is the best library, namespace ?

Well, what is "best" depends very much on what you want to do, and how
much control you want.

If you just want to display images, the Image / Bitmap classes are
probably the ones you want. Be forewarned, though, that
Image.FromFile() leaves the TIF file locked for a while... probably
until the garbage collector gets around to doing something with the
objects that FromFile was using to read the file.

I read the TIF file into a MemoryStream and then feed it to
Image.FromStream(), like this:

Image fullImage;
System.IO.Stream st = System.IO.File.Open(imageFilePath,
System.IO.FileMode.Open, System.IO.FileAccess.Read,
System.IO.FileShare.Read);
try
{
byte[] b = new byte[st.Length];
st.Read(b, 0, b.Length);
System.IO.MemoryStream ms = new System.IO.MemoryStream(b);
fullImage = Image.FromStream(ms);
}
finally
{
st.Close();
}

which ensures that the file lock is released as soon as possible.

Be also forewarned that the Image class limits your control over the
image format. There are a limited set of bit depths at your disposal,
for example, which can cause a lot of bloat in memory as tiny
black-and-white TIF images are blown out into (unnecessary) 8-bit or
16-bit colour in memory.

Nonetheless, if all you want to do is show pictures to your user, this
is no doubt the simplest way to do that.

Sep 18 '06 #5
Actually, "GDI+" is just a generic term for the graphics namespaces in .Net.
You would have to (as I did) create your own class(es) to parse the TIFF
file if you want to get at the tags in it, multiple images, etc. So, unless
you want to do that, a commercial .Net TIFF library is your best bet.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"Sameer Gupta" <Sa*********@discussions.microsoft.comwrote in message
news:36**********************************@microsof t.com...
Thanks very much Bruce.

Actually I have lot of Tiff files, many of them are corrupted.
I need to programmatically validate / check the existing tiff files
whether
they are corrupt or not. a read only mode. also don't wanna lock files.

GDI + is an option. also there is VintaSoft.Tiff library for .Net.

Please help in finding an appropriate way.
Regards
Sameer Gupta
C# Designer & Developer
Siemens
UK
"Bruce Wood" wrote:
>>
Sameer Gupta wrote:
what are options for opening / handling tiff files in .Net framework ?
which is the best library, namespace ?

Well, what is "best" depends very much on what you want to do, and how
much control you want.

If you just want to display images, the Image / Bitmap classes are
probably the ones you want. Be forewarned, though, that
Image.FromFile() leaves the TIF file locked for a while... probably
until the garbage collector gets around to doing something with the
objects that FromFile was using to read the file.

I read the TIF file into a MemoryStream and then feed it to
Image.FromStream(), like this:

Image fullImage;
System.IO.Stream st = System.IO.File.Open(imageFilePath,
System.IO.FileMode.Open, System.IO.FileAccess.Read,
System.IO.FileShare.Read);
try
{
byte[] b = new byte[st.Length];
st.Read(b, 0, b.Length);
System.IO.MemoryStream ms = new System.IO.MemoryStream(b);
fullImage = Image.FromStream(ms);
}
finally
{
st.Close();
}

which ensures that the file lock is released as soon as possible.

Be also forewarned that the Image class limits your control over the
image format. There are a limited set of bit depths at your disposal,
for example, which can cause a lot of bloat in memory as tiny
black-and-white TIF images are blown out into (unnecessary) 8-bit or
16-bit colour in memory.

Nonetheless, if all you want to do is show pictures to your user, this
is no doubt the simplest way to do that.


Sep 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to...
0
by: Will Arrowsmith | last post by:
Hi All, I am trying to create a .tiff file to fax using the windows fax service FAXCOMLib. I have created an array of images (bitmaps) and converted them to 1pbb format in order to allow...
5
by: mesh2005 | last post by:
I'm new to C# , I use MS visual studio.NET 2003. I have some TIFF images, I want to write a program using c# that reads an image (.tiff) and prints all its tags. can anyone guid me to the right...
1
by: amit gupta | last post by:
Hello, I am using QuarkXPress on Macintosh to generate EPS Files with Tiff Preview embedded in it. I have written some C code to extract Tiff Preview from EPS files generated which works pretty...
3
by: Andres Corrada-Emmanuel | last post by:
Hello, I have installed PIL 1.1.5 on Windows with Python 2.4. I'm unable to open .tiff images that I can open and view using Windows Explorer. In other words, this simple test fails: import...
1
by: Stedak | last post by:
I have the following class I use to save Tiff's. The problem I have with it is that the final size of the images are very large. If we scan directly to a file the final tiff may be 600-900 kb.s but...
0
by: Stedak | last post by:
We are scanning images and saving them as TIFF's in a database. We are running into some problems because in the creation of the TIFF the EncoderValue.CompressionLZW is ignored. It does not seem to...
0
by: stuinstra35 | last post by:
I need help converting a PixelFormat.Format16bppRgb555 image to a PixelFormat.Format1bppIndexed image in VB.net The images I'm working with are all black and white documents. I create the...
2
by: mndprasad | last post by:
hi all i am doing a project in java where i need to convert 10 jpeg images into a single tiff image..conversion of single jpeg image to single tiff is happening but embedding all the 10 jpeg images...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.