DCSIMG
October 2007 - Posts - Essential WPF

October 2007 - Posts

62
Comments

WPF Localization - On-the-fly Language Selection by Tomer Shamam

Download code ver 1.3 from here . Many of my customers asked me: How WPF supports localization and globalization? Is there any built-in mechanism for choosing a language on-the-fly, at runtime and without closing any window? How do I translate formatted text with parameters? Well..., you know the story,... aren't you!? No? So start by reading this , and this . Still confused? continue with this and also this . As you can see, there is more than one solution. Each has its pros and cons. The WPF...
5
Comments

WPF Official Image Interop by Tomer Shamam

As I wrote my few last posts about how to access the BitmapSource WIC image pixels, I have found a post in the MSDN forum, which exposes a static class called Imaging . This amazing class which somehow was very hard to find, can do a great work with image-interop. Looking inside the MSDN for the Imaging class, I found the following methods: CreateBitmapSourceFromHBitmap CreateBitmapSourceFromHIcon CreateBitmapSourceFromMemorySection The CreateBitmapSourceFromMemorySection is the best match for creating...
תגים:, , ,
2
Comments

WPF Image Processing Under the Hood by Tomer Shamam

In the last two posts I have showed how to create a BitmapSource image and access its underlying WIC image, for manipulating its pixels. In this post I will explain how does the WICBitmap* works. Download the code from here . Looking inside the BitmapSource class using Reflector , it figures out that it encapsulates a WIC image (_ wicSource ). The WICBitmap class uses reflection to retrieve this private field: public WICBitmap( BitmapSource source) { Type bitmapSource = typeof ( BitmapSource ); FieldInfo...
2
Comments

WPF Raw Video by Tomer Shamam

In my last post I showed how to access the WPF's BitmapSource underlying WIC image, and I promised to explain my code, and also to post an Image stream (Video) code based on my solution. In this post I will quickly talk about the unique CompositionTarget class, and I will show how to render a Raw Video using its Rendered event. Download the code from here ( FYI - I refractor the code from the last post and fixed several bugs ). I will start by reminding one of the disadvantages of my WICBitmap...
Powered by Community Server (Commercial Edition), by Telligent Systems