Releasing Image effects Template?

Discussions about machine vision support in GdPicture.
Post Reply
prosigma
Posts: 8
Joined: Tue Nov 10, 2009 2:26 pm

Releasing Image effects Template?

Post by prosigma » Tue Nov 10, 2009 3:01 pm

Hello!
Recently i discovered, that there EXISTS a method to release GdPictureImages. I thought it would do by itself, and now i've got to patch the whole project due to its caused garbage files. (Located in "Document and Settings\User\Local Settings\Temp")

But there occured one question:

Code: Select all

private bool loadTemplates(List<byte[]> blobs)
{
   try
   {
      foreach (byte[] blob in blobs)
      {
         byte[] b = blob;
         int img = this.m_image.CreateGdPictureImageFromByteArray(ref b);
         int templateHandle = this.m_image.ADRCreateTemplateFromGdPictureImage(img);

         this.m_image.ReleaseGdPictureImage(img);
      }
      return true;
   }
   catch
   {
      return false;
   }
}
Is the template still in the memory, when releasing its source image?
If it is: How can i remove the template from the memory?
If it isn't: How can this problem be solved, aside from remembering the imageID until the program exits and removing them at the end?

Thanks,
Thomas

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

Re: Releasing Image effects Template?

Post by Loïc » Tue Nov 10, 2009 3:16 pm

Hi Thomas,

Is the template still in the memory, when releasing its source image?
Yes.
If it is: How can i remove the template from the memory?
ADRDeleteTemplate()


Kind regards,

Loïc

prosigma
Posts: 8
Joined: Tue Nov 10, 2009 2:26 pm

Re: Releasing Image effects Template?

Post by prosigma » Tue Nov 10, 2009 3:29 pm

Thank you, Loïc!

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

Re: Releasing Image effects Template?

Post by Loïc » Tue Nov 10, 2009 3:30 pm

Here to serve !

You are welcome ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest