all groups > dotnet drawing api > september 2007 >
You're in the

dotnet drawing api

group:

Bitmap access denied with .net 3.0


Bitmap access denied with .net 3.0 nicolasr
9/21/2007 2:32:47 AM
dotnet drawing api:
Hi,

I'm quite new to .Net 3 and WPF.
In my code I am using Image controls that are shown
in a ScrollViewer. When the user changes the galerie to
look at I need to clear the ScrollViewer and dispose all
image controls I created.
The problem is neither the Image control nor the contained
BitmapImage do provide any Dispose() or Destroy() method.
The result is that when I try to load the images the next time
I get "access denied" errors. Probably because there are
still living objects in the garbage collection that exclusively
access the image files.

Any idea what I am missing?

Re: Bitmap access denied with .net 3.0 Bob Powell [MVP]
9/23/2007 7:01:39 PM
Hi, This group is for GDI+

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


[quoted text, click to view]
Re: Bitmap access denied with .net 3.0 nicolasr
9/24/2007 1:35:06 AM
Sorry, I wasn't aware of this.

Since group archives probably already saved this post
I want to shortly mention the fix I found:

BitmapImage.CacheOption = BitmapCacheOption.OnLoad;


[quoted text, click to view]
AddThis Social Bookmark Button