DCSIMG
Tips and Tricks,.NET 3.5,WPF - Just code - Tamir Khason

Browse by Tags

All Tags » Tips and Tricks » .NET 3.5 » WPF (RSS)
Please update your bookmarks, because the new url of this blog is http://khason.net/ (you have not update RSS feeds, it will be done automatically). Why I did it? Why I decided to go to “stand-alone”… Well. there are some reasons. Generally, I do not want to explain all those here, but trust me, there are some. The main reason is, that there is no responsible person in charge for this blog platform in Microsoft Israel. This why, if your blog is popular and you have a respect to your blog visitors...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/read-and-use-fm-radio-or-any-other-usb-hid-device-from-c/ ] Last time we spoke about reading and decoding RDS information from FM receivers . Also we already know how to stream sound from DirectSound compatible devices . However, before we can do it, we should be able to “speak” with such devices. So, today we’ll spoke about detection and reading information from Radio USB adapters (actually...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/capturing-and-streaming-sound-by-using-directsound-with-c/ ] I already wrote a little about managed way to use DirectX DirectSound . Today we’ll speak about how to get sound from your microphone or any other DirectSound capturing device (such as FM receiver ) and stream it out to your PC speakers and any other DirectSound Output device. So, let’s start creating our first echo service...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/quick-silverlight-and-wpf-tip-how-to-write-program-without-xaml/ ] From the moment, 10K MIX09 contest was launched , I got more, then 20 people, asking the same question: Is it possible to have Silverlight program up and running without XAML at all? The answer is “ YES, IT IS ”. Here is how: All you need for run WPF or Silverlight application is Class inherited from System.Windows.Application...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/reading-and-decoding-rds-radio-data-system-in-c/ ] RDS or Radio Data System is very common in US and many European countries. It is communication protocol used to send small amount of digital information using regular FM radio broadcast. This protocol is used to "tell" your receiver about alternative frequencies, time, program notifications, program types, traffic information...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/how-to-pinvoke-varargs-variable-arguments-in-c-or-hidden-junk-in-clr/ ] Recently I wrote a cheat sheet for pinvoking in .NET . Shortly after I got a question in comments about how to deal with variable arguments, when it's more, then one parameter. Also what to do if those arguments are heterogeneous? Let's say, that we have following method in C: int VarSum(int nargs, ...){ va_list...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/auto-scroll-listbox-in-wpf/ ] In WinForms era it was very simple to autoscroll listbox content in order to select last or newly added item. It become a bit complicated in WPF. However, complicated does not mean impossible. As for me, Microsoft should add this feature to base ListBox implementation as another attempt to be attractive environment for LOB application. See, for example this...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/pinvoke-cheat-sheet/ ] I’m working a lot with p/invoke, and know how it’s hard to produce correct signature for unmanaged method. So, today I decided to publish basic cheat sheet for methods, parameters and attributes you should use in order to invoke unmanaged methods from managed code without a lot of problems. We start with data type translations. Here the table to understand it. Data...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/set-binding-based-on-trigger/ ] Let’s say, that you want to set binding. However, you want to set it by using some trigger. Wait! Why I need it? Let’s say, that I have some very special object, that actually has no hard-coded properties. All it’s properties are created during the runtime, based on some trigger. In this case, I still want to use binding, however, if the property does not...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/hlsl-pixel-shader-effects-tutorial/ ] Recently, I already wrote about PixelShader effects , introduced in .NET framework 3.5 SP1 (WPF). However it looks like for most people this syntax is still hard to understand. Today we’ll try to lean it more. In order to do this, I wrote small program, that helps you to write and debug pixel shader effects quickly. This how it looks like Hit Open...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/brightness-and-contrast-manipulation-in-wpf-35-sp1/ ] While being in flight, I had to learn new features, introduced in .NET 3.5 SP1. So, let’s start from image manipulation. I want to perform contrast and brightness manipulation in GPU over displayed image. In order to begin, you should download and install .NET 3.5 SP1 and Visual Studio 2008 SP1 . Meanwhile (it’s about 500 MB of download...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/search-and-highlight-any-text-on-wpf-rendered-page/ ] Today we’ll speak about how to search and select text on WPF page. This is not about how to search data sources, or how to search for data. This is visual search. Like this one Let’s see how XAML looks like <Grid Name="root"> … <StackPanel Grid.ColumnSpan="2" Grid.Row="1" Name="panel">...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/webcam-control-with-wpf-or-how-to-create-high-framerate-player-with-directshow-by-using-interopbitmap-in-wpf-application/ ] Did you ever see, that MediaElement “eats” about 30% of CPU while playing movie in WPF? Did you thought, that you  can display live camera capture in WPF with 60 fps full screen (I have really high resolution 1920x1200) and 2% of  CPU? You did not? Let...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/quick-wpf-tip-how-to-bind-to-wpf-application-resources-and-settings/ ] You, probable know, that you can save application resources and settings within handy classes Settings and Properties, provided by Visual Studio code generator. Just put your values, set the usage scope and all you have to do is to save it upon request. This feature is really useful and great time saver. But how to...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/wordml-to-flowdocument-%e2%80%93-how-to-convert-docx-files-to-wpf-flowdocument/ ] Recently we spoke about converting XPS files and FixedDocuments to FlowDocuments . It works, but there are lot of problems, due to fact, that FixedDocument (or XPS/PDF document) has less information, then the original file. Those files are, actually, printout of the original document. Also we know how to...
More Posts Next page »