This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, December 18, 2011 6:38:32 AM(UTC)
Groups: Registered
Posts: 13
Hello,
Lets say I need to get the Width of a specific bitmap within a bitmap list.
I use my own method GetWidthFromBitmap for this .
In this method I get a specific bitmap into MyBitmap (of type BITMAPHANDLE) by the method L_GetBitmapListItem.
My question - do I need to call at the end of my method (GetWidthFromBitmap):
L_FreeBitmapMyBitmap);
?
Here is my method:
function TNewImagingManipulator.GetWidthFromBitmap(): Integer;
var
MyBitmap: BITMAPHANDLE;
ImagesListHandle: HBITMAPLIST;
begin
L_GetBitmapListItem(ImagesListHandle, 0, @MyBitmap, sizeof(BITMAPHANDLE));
Result := MyBitmap.Width;
L_FreeBitmap(@MyBitmap);
end;
Plesae explain.
Thanks a lot in advance.
#2
Posted
:
Sunday, December 18, 2011 6:48:10 AM(UTC)
Groups: Registered
Posts: 13
I have to mention that
ImagesListHandle: HBITMAPLIST;
is a parameter for the method, meaning I dont want to free ImagesListHandle.
#3
Posted
:
Monday, December 19, 2011 6:11:40 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
By freeing Bitmaphandle, you are already freeing the bitmap in the Bitmaplisthandle as well.
You must not call L_FreeBitmap for the list item you retrieved using L_GetBitmapListItem.
You only need to free the entire list after you're done with it.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
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.