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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, December 10, 2008 2:12:39 PM(UTC)
lazycoder

Groups: Registered
Posts: 4


In a directory of 317 images I have 3 gifs that cause an error because CreateLeadDC() on those images returns a null pointer. I'll attach one of those images.

This is the code I'm using:

IntPtr hDC = IntPtr.Zero;
try
{
hDC = canvas.CreateLeadDC();
using (Graphics g = Graphics.FromHdc(hDC))
{
this.TopZone.CalculateSize(g, renderingWidth);
this.BottomZone.CalculateSize(g, renderingWidth);
}
}
finally
{
if (hDC != IntPtr.Zero)
RasterImage.DeleteLeadDC(hDC);
}
}


Your help is greatly appreciated.
lazycoder attached the following image(s):
gallerypoppedup.gif
 

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, December 11, 2008 2:08:54 PM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 356


The attached image has a pixel depth (color resolution) of 7 bits per pixel. This value is correct for GIF images and for LEAD bitmaps in memory, but it is not compatible with GDI. You can try to load it at 8 or 24 BPP, or convert it using the ColorResolutionCommand class.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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-2020, Yet Another Forum.NET
This page was generated in 0.122 seconds.