How to clear the memory of Image object

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
wizards
Posts: 46
Joined: 2008-12-05T06:31:55-07:00

How to clear the memory of Image object

Post by wizards »

Hello,

I want to read a max of 4 (Some times < 4 also) images and should display them simultaneously. If I read two then images will display horizontally i.e one on top and other on bottom. If I read 4 then 4 images will display on 4 parts of monitor. I did this using VC++.

To store 4 images i took an array of Images like

Code: Select all

 Image m_Image[4].
First time if I read 4 images then it takes memory for 4 images. Suppose if one image takes 1MB then for 4 images 4MB.
Second time if I read only two then my application is not realizing the other two images memory.

I want to release memory of the m_Image array before reading second time.

I did not find any method on Magick++ API to clear memory. I can't replace the array with pointers because i need to change lot of code.

Can you please help me how to clear memory.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to clear the memory of Image object

Post by anthony »

There should be something to Delete Images...
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply