Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, December 18, 2011 6:38:32 AM(UTC)

hmofaz  
hmofaz

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.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, December 18, 2011 6:48:10 AM(UTC)

hmofaz  
hmofaz

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)

mohamed  
mohamed

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.

LEAD Logo
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.067 seconds.