How to bypass the image cache when loading a BitmapImage from a file
Hi,
I'm trying to display an image on some control, this works fine, but my image content changes based on user input.
I reload and refresh the user-interface using the code below :
The update works until I load an other XAML page, using GUI::LoadComponent, and then when
I reload back the page contaning the "PhotoModiface" image control, and refresh it using the above method, the image is always the one
loaded just before the page change, like if GUI::LoadComponent was caching the images based on their Uri.
Is there a way to bypass this cache ? I wasn't able to find how.
Thanks
I'm trying to display an image on some control, this works fine, but my image content changes based on user input.
I reload and refresh the user-interface using the code below :
Code: Select all
Noesis::Image* pImage = m_pMainWindow->FindName<Noesis::Image>("PhotoModiface");
if (pImage != nullptr)
{
Noesis::BitmapImage* pBitmapImage = new Noesis::BitmapImage(szScreenShotFile.c_str());
Noesis::Ptr<Noesis::ImageSource> pScreenShotImage = *pBitmapImage;
pImage->SetSource(pScreenShotImage);
}
I reload back the page contaning the "PhotoModiface" image control, and refresh it using the above method, the image is always the one
loaded just before the page change, like if GUI::LoadComponent was caching the images based on their Uri.
Is there a way to bypass this cache ? I wasn't able to find how.
Thanks
Re: How to bypass the image cache when loading a BitmapImage from a file
I assume you are installing your own TextureProvider. In that case, every time your filename is modified you can invoke
and it will automatically reload.
Code: Select all
RaiseTextureChanged("MyImage.png");
Re: How to bypass the image cache when loading a BitmapImage from a file
Thanks a lot, that's what I was looking for, seems to work well.
Who is online
Users browsing this forum: Google [Bot] and 85 guests