ImageBrush.ImageOpened ImageBrush.ImageOpened ImageBrush.ImageOpened ImageBrush.ImageOpened Event


Occurs when the image source is downloaded and decoded with no failure. You can use this event to determine the size of an image before rendering it.

public : event RoutedEventHandler ImageOpened
// Register
event_token ImageOpened(RoutedEventHandler const& handler) const;

// Revoke with event_token
void ImageOpened(event_token const& cookie) const;

// Revoke with event_revoker
ImageOpened_revoker ImageOpened(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler ImageOpened
Public Event ImageOpened As RoutedEventHandler
<ImageBrush ImageOpened="eventhandler"/>


For the scenario of checking the size of an image before rendering, that info isn't part of the ImageOpened event data. Instead, the fact that the event fired is the notification that the PixelHeight and PixelWidth values of the image source (ImageSource value) are available.