Recently, I have been faced to a strange issue in one of our application.
That application has been validated to work on bigger screen size, and we notice at that time that bitmaps graphics was badly render on such big screen mainly due to different pixel size.
To solve that bad rendering of such bitmap on such screen size, we had to use the BitmapScalingMode property of an Image control.
<Image RenderOptions.BitmapScalingMode=”HighQuality” Source=”/Resources/key.png” Width=”40″ Height=”40″ Stretch=”Fill” VerticalAlignment=”Center”/>
Has shown is sample code above, setting the property to HighQuality value was rendering the image nicely on bigger screen. So far so good then.
Next steps was to test the application on this same type of screen but under Windows 8, working perfectly well as well until the time it has been updated to Windows 8.1 and get our application crash with an OutOfMemoryException.
After days of testing we have identify that it was occurring when used image was about 8 bits and 256 colors. This has been reported as a bug by Microsoft on Windows 8.1 update.
Different possible Work around:
- With your prefer graphic tool generate a files from your image with more depth
- If you have no control of the image you have and want to still use it you card converted from code by the following code snippets
BitmapSource ResizeImage(BitmapSource image, int width, int height)
var bmp = new FormatConvertedBitmap(image, PixelFormats.Bgr24, null, 0);
return new TransformedBitmap(bmp, new ScaleTransform((double)width/bmp.PixelWidth, (double)height/bmp.PixelHeight));
Hope this will save you some times 🙂
For those like me who like to get a flexible code and easy maintenable possibilities as well as flexibilities, since I discover and implement the MVVM pattern with WPF, I can say that I could not leave without it.
Before going to that pattern I have test different approach like Prism, MVVM ToolKit and other open source project. Based on my test result and personnal needs, my choice goes to MVVM tool Light toolkit. Why? simply because of its name ” Light” . Prism so far was a too heavy package based on what I was using.
What is cool is that the MVVM Light tool kit is nicely maintenain by Laurent Bugnion and get an update version for Windows 8 actually.
Those post below describe the MVVM pattern under Windows 8 and WinRT. Nice articles to step in and discover some interresting points covered:
First the time I start to explore the windows store and all books and article around, gettings started section is the famous part where all of us usually start from.
But then nothing much on good rules in order to get your app certified.
I discover a nice article on this topic. Please refer to the following blog post if you are still wondering:
Every geek or developper like me would like to keep informed of the latest developments with Surface.
That’s done, just got the info to my mail box today that Surface is available for pre-order today
starting at 9am Pacific Time on Surface.com. Get your order in today!
A store for Windows 8 application ?
Yes, your read right, a store for Windows 8 application has been introduced. Hmmm are they following the Mac OS strategy by going through the certification process of apps ?
In fact you have the choice. from visual studion you will be able to publish your appliation on the Store, same as we do today for windows phone application. Bad or good, I do not know yet personnaly but would expect they will be not too much locking as Apple is doing today.
Anyhow real cool feature in windows 8:
- Faster boot, less that 5 seconds
- Rich user experience
- fluidity of the information
- fast application launching and switching
- Multi programming language
- Live connection to web service
- better management of ressources
- Support of Hyper-V
And much more to come….