Handle is not initialized.

General discussions about GdPicture.NET.
Post Reply
rupeshk
Posts: 2
Joined: Wed Jan 13, 2016 11:54 am

Handle is not initialized.

Post by rupeshk » Wed Jan 13, 2016 12:17 pm

I have an Image Cleaning Application and I process near about 3000 Multipage Tiff. i'm facing the 'Handle is not initialized' issue while cropping. can you please Hepl me for the same...

Here is the Cropping Code

Code: Select all

private void btnCrop_Click(object sender, EventArgs e)
        {
            try
            {
                int croped = oGdPictureImaging.CreateNewGdPictureImage(oGdPictureImaging.GetWidth(m_ImageID), oGdPictureImaging.GetHeight(m_ImageID), 24, Color.White);
                List<Point> listofpnt = new List<Point>();

                if (listofRect.Count > 0)// listofRect is having a rectangles to be cropped.
                {

                    foreach (var item in listofRect)
                    {


                        oGdPictureImaging.GetPixelArrayInteger(m_ImageID, ref pnt, item.X + 2, item.Y + 2, item.Width - 4, item.Height - 4);
                        oGdPictureImaging.SetPixelArrayInteger(croped, pnt, item.X + 2, item.Y + 2, item.Width - 4, item.Height - 4);
                        GdViewer1.DisplayFromGdPictureImage(croped);
                        GdViewer1.Refresh();
                        listoftempDeleted.Add(item);
                    }
                    listofRect.Clear();
                    oGdPictureImaging.GetPixelArrayInteger(croped, ref pnt, 0, 0, oGdPictureImaging.GetWidth(croped), oGdPictureImaging.GetHeight(croped));
                    oGdPictureImaging.SetPixelArrayInteger(m_ImageID, pnt, 0, 0, oGdPictureImaging.GetWidth(m_ImageID), oGdPictureImaging.GetHeight(m_ImageID));
                    GdViewer1.DisplayFromGdPictureImage(m_ImageID);
                    GdViewer1.Refresh();
                    SaveGraphicState(false);
                    oGdPictureImaging.ReleaseGdPictureImage(croped);


                     pnt = null;
                }
            }
            catch (Exception)
            {
                
                throw;
            }
           
        }

User avatar
Loïc
Site Admin
Posts: 5594
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Handle is not initialized.

Post by Loïc » Wed Jan 13, 2016 1:11 pm

Hi,

There is no way to reproduce or understand what the problem is with this snippet.

Could you clarify which version hare you using and if you tried with the latest available?
Also, which line of code is raising the exception?

Kind regards,

Loïc

rupeshk
Posts: 2
Joined: Wed Jan 13, 2016 11:54 am

Re: Handle is not initialized.

Post by rupeshk » Sat Jan 16, 2016 8:36 am

I'm Currently Using GDpicture10 framework.
i create image "m_ImageID=oGdPictureImaging.CreateGdPictureImageFromFile(filename);"
till all the Operations of image processing m_ImageID count was near about 3000+ after that it throws an error. Handle is not initialized or not enough memory to render image.

User avatar
Loïc
Site Admin
Posts: 5594
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Handle is not initialized.

Post by Loïc » Sat Jan 16, 2016 6:06 pm

Hi,

I think your application is running into an out of memory state. The only thing I can suggest with your explanations is to check that you correctly release all unused allocated resources.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests