Since i...">

WPF Image / Rendering Event

I use the Image control to display documents:

<Image x:Name="cImage" SnapsToDevicePixels="True" ... />

Since it takes about half a second to display the image on the screen, I first preview the preview with:

RenderOptions.SetBitmapScalingMode(cImage, BitmapScalingMode.NearestNeighbor);
cImage.Source=...;

Then I set a timer to change the mode to HighQuality.

Is there an event that WPF fires when it finishes rendering that I could use instead of a timer?

+5
source share
2 answers

Will this event be Loaded for the image?

According to http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.loaded.aspx , Loaded is triggered when the content is displayed and ready for interaction.

, , Loaded .

+1

, , .

, , .

- :

BitmapImage src = new BitmapImage();
src.BeginInit();
src.UriSource = tURI;
src.EndInit();
imgImage.SetCurrentValue(Image.SourceProperty, src);
src.DownloadCompleted += ImageDownloadCompleted;

ImageDownloadCompleted, .

+3

All Articles