Sometimes images look nice on a regular computer screen, but when used in your Windows Phone application they become ugly. This effect is most often seen on gradients and images with smooth coloring. In gradient images you’ll start to see stripes and bands. It looks like the colors in the image don’t blend anymore.
Below are the 32bit and 16bit versions of the same images. Notice the banding on the right one.
Cause
This problem may be caused by a setting in your application or just by screen of the phone itself. It occurs when a 32bit image is shown on a 16bit screen. Because there are way more shades of colors available in 32bit images than in 16bit images, you’ll start to see these artifacts when the depth doesn’t match the screen.
Solution
The solution is relatively simple. Just scramble the pixels a bit to make the colors look like they blend. This process is called dithering. Maybe you’ll remember, back in the days with Windows 3.11, you often saw ‘gradients’ in images with only two colors. Starting with 1 color and along the image there appeared more and more pixels of a different color.
Read the full post
Someone the other day tweeted a link to some very cool animated gifs. I love animated gifs !! I have always wanted animated gifs in Silverlight/WPF BUT for reasons unknown they never came. They would have been perfect for A … Continue reading →
A couple of weeks ago we added official WPF support to WriteableBitmapEx. Today I'm happy to announce that WriteableBitmapEx now also officially supports Windows 8 Metro Stlye WinRT .NET XAML. With that WriteableBitmapEx is now available for 4 platforms: WPF, Silverlight, Silverlight for Windows Phone and Metro Style WinRT .NET.
Although Direct2D is the best solution for fast 2D graphics with Windows 8 Metro Style, I think there are scenarios where the WriteableBitmapEx could be helpful, esp. when using C# with XAML. I also know that some devs were waiting for this to port their Windows Phone apps to Windows 8 Metro Style.
WinRT Differences
Unlike the Silverlight WriteableBitmap, the Metro Style WriteableBitmap doesn't provide the pixel data directly. Its IBuffer PixelBuffer property doesn't have an interface to get the color information. Fortunately there are a few C# extension methods available which provide the pixel data as byte array or stream in the BGRA pixel format. Yes, BGRA and not like all the other platforms supported by WriteableBitmapEx as ARGB. The BGRA format is mainly used by Direct2D, which might be the reason for this hidden, but important difference of the Metro Style WriteableBitmap.
Read the full post
Its been a while since I posted anything on this blog. Thought I’ll break the calm with a quick post about my recent sketch.
I generally use Autodesk SketchBook Pro (SBP) on my Mac for the intial doodling. I then develop a fairly finished sketch before importing it into Photoshop for any post-processing. Luckily SBP saves the files in PSD format, making it easy to do the Photoshop import. The following sketch was entirely done in SBP:
This was done in about 30 mins as a quick sketch to demonstrate the use of SBP and a Wacom tablet to a close friend. He was quite impressed and immediately ordered a bunch of items, including a Wacom Bamboo stylus for the iPad. I guess marketing wouldn’t be a bad alternate career!
BTW, the sketch is called Rain and Tears.
In the WPF and Silverlight “desktop” worlds we have the luxury of being able to use shader effects (fx) in our apps, this infrastructure is not available in the “Windows Phone” or “WinRT XAML/C#” worlds. However thanks to SharpDx and … Continue reading →
In the categories 'windows8; XNA'
The Tags 'WinRT' Comments Off.
The next update of Physamajig will allow users to create their own "Mini-Games" - without writing code! This new version will be released after the June 2012 Windows 8 Release Preview. Like the current release of Physamajig, you just draw out elements on the screen to create physics objects - but in the new version, you can add Behaviors to your objects to add much more interactivity.
So what kind of games will Physamjig allow you to create without using code? This video shows a few examples:
Read the full post
Interested in learning more about game programming with XNA or building applications for Windows Phone 7? Two free all-day events are coming to Phoenix in May that you can attend to learn more. These events are always a ton of fun with some talks on the different technologies, labs, and hands-on time to actually build a custom game/application. Did I mention that there will be prizes given out and free food as well? Register at the links below and I’ll look forward to seeing you there!
XNA Game Development with Dan Wahlin, Spike Xavier, Rico Rodriguez, Lou Prado, and Ryan Plemons, May 5th, Tempe, AZ.Register
Now that many of you have had the opportunity to check out Kirupa’s Visual Studio Toolbox episode on Channel 9 for visually building HTML apps using Blend you are probably wondering where is the video for XAML authoring? Look no further! I met with Robert Green last week and we walked through building out a simple Metro app starting with the Grid app project template. You can view the recording below (or download a high-quality MP4):
During this video I used both the XAML Designer in VS and Blend, highlighting the similarities and differences for each product. Highlights include some tips and tricks for quickly creating the object hierarchy, laying out your scene, adding animations and transitions, and new tooling specific to Metro app controls and app design.
Joanna
Let’s say you’re working on a HTML Metro app and you’d like to reuse some C# code instead of rewriting, the good new is that you can, here’s how:
Create a blank new WinJS application and add a div inside default.html page:
<body><divid="output"></div></body>
Now add a new C# library to WinJS solution:
Change the output type of the library project to WinMD file
let’s add a couple of classes to C# library, we’re going to consume them from our HTML application:
publicsealedclass Person
{
public Person(string name)
{
this.Name = name;
this.Address = new Address() { City = "Milano", Code = 20100 };
}
public Address Address { get; private set; }
publicint Age { get; set; }
publicstring Name { get; private set; }
publicint CalcSum(int a, int b)
{
return a + b;
}
}
publicsealedclass Address
{
publicstring City { get; set; }
publicint Code { get; set; }
}
When you are designing new HTML-based Metro style applications, you’ll likely want to add one or more WinJS AppBar controls to your app. In this short tutorial, we’ll cover how to use the HTML authoring tools in Blend to create, interact with, and customize WinJS AppBar controls.
You’ll find more information about using app bars on the Windows Developer Center: