Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How the Foxtrot can I release the Hashtable's associated resources?

 

I load 30 large bmps which will "eat" about 45MB of ram. Then, If I reload them, an aditional 45MB will be consumed. So, basicaly, If I reload these pictures 5 times more the 200MB will be consumed, even with the myHasTable.Clear() property and the CollectGarbage before reloading these images...

 

Also, the Hashtable don't have the "Dispose()" property... What the...

 

This Hastable of mine is static so I would only like to dispose it's associated resources rather then disposing the object itself...

Posted

isnt this what an image list is for? Wont disposing an image list dispose the Bitmaps?

 

load your images into an image list.

Add references to the images to a hash table.

to free, dispose the image list, reset your hashtable.

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
Hi Joe,

 

Unfortunately the Image List object is limited to 256 by 256 pixels.

yeah. . . that could be a problem I guess :o

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
yeah. . . that could be a problem I guess :o
by the way. . . are you in 1.1 or 2.0?

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted

I can add a 1024x768 to an imagelist in 2.0.

 

is this a limitation to 1.1?

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
I can add a 1024x768 to an imagelist in 2.0.

 

is this a limitation to 1.1?

I can do it in 1.1 too.

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
I can do it in 1.1 too.

ahh. . . Im a moron. . yeah I can add it. . . but it comes back out as the size specified by the Imagelist.

 

that sux.

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
I believe what Joe Mamma meant was that you can add an image of any size to an image list, but it automatically resizes the Image to the size specified by the Image list (which is a maximum of 256).
Anybody looking for a graduate programmer (Midlands, England)?
Posted
I believe what Joe Mamma meant was that you can add an image of any size to an image list' date=' but it automatically resizes the Image to the size specified by the Image list (which is a maximum of 256).[/quote']

 

Yeah I understood that. What I did not realise was if that "resize thingie" also happens in v2.0 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...