Results 1 to 3 of 3

Thread: Managing Bitmaps

  1. #1

    Thread Starter
    Hyperactive Member Troy Lundin's Avatar
    Join Date
    May 2006
    Posts
    489

    Managing Bitmaps

    I have 6 bitmaps, all the same size. Their ImageFormat is Format32bppPArgb. Sometimes when I try to resize the bitmaps I get the Out of Memory message. This doesn't happen all the time, only after about six or seven resizes.

    In Task Manager, the program's memory use never goes above 800k.

    So, a couple questions:

    Is there a way to resize a Bitmap without creating a new one?
    If I have to recreate the Bitmap, do I need to dispose the current one (or set it to Nothing)?

    Thanks.
    Prefix has no suffix, but suffix has a prefix.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Managing Bitmaps

    to be sure you use the minimum resources possible, dispose the old bitmap, then call GC.Collect

  3. #3

    Thread Starter
    Hyperactive Member Troy Lundin's Avatar
    Join Date
    May 2006
    Posts
    489

    Re: Managing Bitmaps

    Ok, thanks.

    Also, why am I even getting the Out of Memory error when I still have at least 4GB of memory available?
    Prefix has no suffix, but suffix has a prefix.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width