Very slow performance displaying Tiff file...

J

johnb41

In my app, I need to open up a multipage tiff file, and also display
it's thumbnail images IN HIGH QUALITY. (High Quality meaning
anti-aliased, and looking good; not rough and pixely) The thumbnail
images are displayed in a ListView control. (I go through each page of
the file, create a thumbnail of it, and put it into an ImageList. Then
i hook that imagelist up to the ListView.)

It works fine, but it is VERY slow. Creating and displaying the
thumbnails for a 50-page file takes up to 39 seconds. I got it down to
22 seconds, but the quality was unusable.

In comparison, I opened up the same 50-page tiff in the efax viewer
(www.efax.com), and it opened up in a blink of an eye; pretty much
instantly.

Is it slow because .NET is just slow in this area, or am I doing
something wrong?

Here's my general workflow for displaying a SINGLE tiff. (to create 50
thumbnails, i just do some looping and adding to an ImageList control.)

Dim bmp As New Bitmap("c:\aaa\tiff\3soft-2-7-05.tif")
Dim bmp2 As New Bitmap(100, 150)
Dim g As Graphics = Graphics.FromImage(bmp2)

g.InterpolationMode =
Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
g.DrawImage(bmp, 0, 0, bmp2.Width, bmp2.Height)
picturebox1.image = bmp2

Originally I used the getthumbnailimage method of the Image object to
do this. That was about just as slow as the method above. But it
didn't allow me to change the interpolationmode.

Thanks for any help with this!

John
 
K

Ken Tucker [MVP]

Hi,

Maybe this will help.

http://www.bobpowell.net/highqualitythumb.htm

http://www.bobpowell.net/addframes.htm

http://www.bobpowell.net/generating_multipage_tiffs.htm

Ken
-------------------------
In my app, I need to open up a multipage tiff file, and also display
it's thumbnail images IN HIGH QUALITY. (High Quality meaning
anti-aliased, and looking good; not rough and pixely) The thumbnail
images are displayed in a ListView control. (I go through each page of
the file, create a thumbnail of it, and put it into an ImageList. Then
i hook that imagelist up to the ListView.)

It works fine, but it is VERY slow. Creating and displaying the
thumbnails for a 50-page file takes up to 39 seconds. I got it down to
22 seconds, but the quality was unusable.

In comparison, I opened up the same 50-page tiff in the efax viewer
(www.efax.com), and it opened up in a blink of an eye; pretty much
instantly.

Is it slow because .NET is just slow in this area, or am I doing
something wrong?

Here's my general workflow for displaying a SINGLE tiff. (to create 50
thumbnails, i just do some looping and adding to an ImageList control.)

Dim bmp As New Bitmap("c:\aaa\tiff\3soft-2-7-05.tif")
Dim bmp2 As New Bitmap(100, 150)
Dim g As Graphics = Graphics.FromImage(bmp2)

g.InterpolationMode =
Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
g.DrawImage(bmp, 0, 0, bmp2.Width, bmp2.Height)
picturebox1.image = bmp2

Originally I used the getthumbnailimage method of the Image object to
do this. That was about just as slow as the method above. But it
didn't allow me to change the interpolationmode.

Thanks for any help with this!

John
 
J

johnb41

Thanks for the links to that very informative site. I'll spend alot of
time there.

Unfortunately it looks like i'm doing the basics correctly. So it
looks like currently .NET just isn't able to generate graphics very
fast. But if anyone knows a technique to create many thumbnail images
(or non thumbnails) lightening fast, please post it here! 39 seconds
for a 50 page tiff is just uncalled for, when other apps do it
instantly. :(

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top