Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, April 27, 2011 5:48:57 AM(UTC)


Groups: Registered
Posts: 11

Hi All,

I'm needing to convert a compressed or otherwise formatted image with LEADTools to a GDI+ image for custom GDI+ drawing. The problem is that when I use the RasterImageconverter.ConvertToImage it is only taking the first page of the image... not all pages. is there another method or a flag to do this?

Dim oCodec As Leadtools.Codecs.RasterCodecs = Nothing
Dim oImage As Leadtools.RasterImage = Nothing
Dim oGDIImage As System.Drawing.Image = Nothing

oCodec = New Leadtools.Codecs.RasterCodecs

oImage = oCodec.Load(sImagePathToPrint)

oGDIImage = Leadtools.Drawing.RasterImageConverter.ConvertToImage(oImage, Leadtools.Drawing.ConvertToImageOptions.None)

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, April 28, 2011 5:34:38 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

There is no direct way to convert a Multipage RasterImage to Multi-frame System.Drawing.Image object and keep all pages.
To workaround this issue, you can use something like the following code:
tempImage = codecs.Load(@"C:\DelMe\Multi.tif");
List<Image> images = new List<Image>();

for (int i = 1; i <= tempImage.PageCount; i++)
System.Drawing.Image oGDIImage;
tempImage.Page = i;
oGDIImage = Leadtools.Drawing.RasterImageConverter.ConvertToImage(tempImage, Leadtools.Drawing.ConvertToImageOptions.None);

Maen Badwan
LEADTOOLS Technical Support
#3 Posted : Monday, May 2, 2011 7:28:40 AM(UTC)


Groups: Registered
Posts: 11

I actually stumbled on an easier method to do it. I simply save the image to a known GDI+ compatible temp file and then open with GDI+, in my case a CCITT4 TIFF. Once finished I clean up the temp file.
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.255 seconds.