Loading...

CreateClonedGdPictureImage and CreateClonedGdPictureImageI?

Discussions about image processing in GdPicture.NET using GdPictureImaging.

CreateClonedGdPictureImage and CreateClonedGdPictureImageI?

Postby jontiefer » Sun Mar 04, 2012 2:44 am

Can anyone tell me what is the difference between the CreateClonedGdPictureImage and CreateClonedGdPictureImageI function? From reading the manual, it seems quite vague. It says the CreateClonedGdPictureImageI version of the function that creates a clone that is indepedent of the source image. However, I tried releasing the source of the first non-I version of the function and the clone version is still alive in memory. Then again, why should a cloning function ever result in keeping another reference to the same image in memory? That seems to defeat the purpose of cloning, altogether. I'm not sure if I just don't understand the wording of the manual or what, but I am not quite sure what the difference is between these functions. Can anyone help me understand this? For now, I suppose it is safer to call the CreateClonedGdPictureImageI version of the function, because I want to make a duplicate of an image that is independent of the source image. I don't quite get what the manual is saying here.
jontiefer
 
Posts: 2
Joined: Sun Mar 04, 2012 2:38 am

Re: CreateClonedGdPictureImage and CreateClonedGdPictureImag

Postby jontiefer » Wed Mar 28, 2012 11:36 am

Anyone have any idea?
jontiefer
 
Posts: 2
Joined: Sun Mar 04, 2012 2:38 am

Re: CreateClonedGdPictureImage and CreateClonedGdPictureImag

Postby Loïc » Thu Mar 29, 2012 4:13 pm

Hello.

We've rewrote the documentation of these 2 methods. Here the new content:

CreateClonedImage()

Creates a new GdPicture Image and initializes it with the contents of another GdPicture Image to minimize memory usage.
If the image to clone is a multibitmap image, this function will clone only the selected bitmap and will create a single frame image.
This function creates a new GdPicture image and initializes it with the contents of the source image until a modification is applied to the cloned image.
Consequently the pixel data of the cloned image can be released from the memory if the image source is released!
If you expect to have 2 independent bitmap stored in the memory you have to use the CreateClonedGdPictureImageI function.
Do not use this function if you intend to release the source image from the memory before the cloned image.



CreateClonedImageI()

Creates a new GdPicture Image and initializes it with a copy of the contents of another GdPicture Image.
The newly created image will be independent of the image source.


Hope this clarify. Let me know if there is something unclear.

Kind regards,

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


Return to Image Processing

Who is online

Users browsing this forum: No registered users and 1 guest

cron