WPF Tip: Displaying Images in different Pixel formats

January 30, 2012

If we want to show an image in WPF, we typically use an Image element and connect its Source property to some image resource within our project: <Image Source="Penguins.jpg" /> The Source property is not a string, it’s an ImageSource – an abstract type with several concrete implementations that provide a “real” image source. The above markup works thanks to the help of a type converter, that makes the source a BitmapImage – one of the simplest sources, that presents the image as is. What if we wanted to show the...

From Enumerable to Observable

January 18, 2012

The IEnumerable<T> interface represents a collection of objects of type T, and is used heavily thanks to the C# foreach construct. Better yet, in the LINQ world, this is the interface that is “extended” via extension methods by the System.Linq.Enumerable class. This makes IEnumerable<T> both easy to use as well as powerful. But is it the best interface for getting data out of a possible collection? Recap: what is IEnumerable<T>? IEnumerable<T> has only one method: GetEnumerator(), that returns an enumerator (what else?), sometimes called an iterator. IEnumerable<T> public interface IEnumerable<out T> : IEnumerable {     new...

First Meeting of the Windows Devices Israel User Group

January 17, 2012

Yesterday evening we’ve held the first meeting of the new Windows Devices user group at Microsoft offices in Ra’anana. This first meeting was dedicated to Windows Phone 7. Elad and I had a lot of fun and we hope you guys had fun as well and learned something along the way. What we’ve done is talk about the Windows Phone platform in general, its capabilities, the tools used to write applications and games, while showing a few demos. We tried to answer as many general questions as we could, and those questions are definitely a basis for future meetings....

Chinese Hotel with no Tea?

January 13, 2012

I was in Shanghai, China this past week, teaching an advanced .NET class at a John Bryce customer’s site. The training went well, and is not the topic of this post. I was in China once before, some 7+ years ago for a non-work related activity – learning Tai Chi Chuan (old Chen style) for a few weeks with a well known master (Master Ma-Hong, 78 years old at the time, if that means anything to anyone. He learned the style from the 5th generation member of the Chen family that invented the style – no small accomplishment; but...

Using the Async CTP With Windows Phone

January 7, 2012

The Async CTP that exposes C# 5.0 features to be used with asynchronous programming is not just for the full .NET Framework. There are versions for Silverlight (4 and 5) and even Windows Phone (which can be viewed as Silverlight 4, but has a separate supporting assembly). To demonstrate, I’ve adapted my sample of the Mandelbrot set to Windows Phone, while taking advantage of the async features to keep the UI responsive. After creating the initial Silverlight for Windows Phone project, I’ve added a reference to the async CTP library, which can be found under {MyDocuments}\Microsoft Visual Studio Async...
no comments

The laptop’s new life with SSD

January 5, 2012

A few days ago I upgraded my hard drives in my laptop to SSD (Solid State Drive). This is one of those things that once you do it – there’s no turning back; you’ll never consider using a “regular” spinning hard disk. Hard disk speed is crucial to a developer – Visual Studio 2010 is a hungry I/O beast, and when various extensions are installed, things get worse. My laptop is no woos - it’s an Alienware m17x-R2, equipped with a Core-i7 processor, 8GB of RAM and an ATI Radeon 5870 card (DirectX 11 capable). This may not seem...
tags: ,
no comments