Image Application in WPF and Perfomance - wpf

I am planning to build Image processing application using WPF. Brightness /Contrast and Histogram are main operation of this application. I have downloaded the application " Foundations: Bitmaps and Pixel Bits" from
http://msdn.microsoft.com/en-us/magazine/cc534995.aspx
. But when I tried to open the images which are more than 1200x1600, It is very slow. How to increase the performance. Is any one worked on Image processing in WPF.
Please suggest me how to solve this perfomance issue in WPF for image(more than 1600x1200) operation.
Thanks you,
Harsha

After a week searching the net I got some useful information. People are using COM DLLs for all the Image related calucualtions and update the WPF application. Here is the link to MSDN:Custom BitmapEffect Sample - RGBFilter
http://msdn.microsoft.com/en-us/library/ms771475(VS.90).aspx
Buut Problem with this is, one have register the COM dll.
But I have also found the sample code where registration of COM Dll is not required.
http://johnmelville.spaces.live.com/cns!79D76793F7B6D5AD!115.entry
I have Opened the Image of size 3000x3500 and changed the RGB values. It is very smooth.
But I didn't understand how slider in the XMAL interact with this COM DLL and How to write this COM DLL.
If any one who understand the this code please explain. It will be very helpful for all.
Thanks and regards
Harsha

Related

What is causing this OpenTK GLControl texture mapping problem?

I'm working on a Winforms project using GLControl 3.10 and I'm trying to use some legacy code written for mobile devices using Xamarin and OpenTK 1.0. It's almost working but I'm having a problem with texture mapping.
I have created a test cube textured with transparent PNG images. The first screen shot below is how it appears on the mobile devices. The second shows how it appears in the new WinForms project.
I've tried adjusting pretty much every GL function call I can find and tried modifying the shaders but I have no idea where the problem might lie. Does anyone have any suggestions where to look?

Exporting an image struct from native code to managed

I have a native codebase that creates an image every 50 ms. I want to use WPF to render this image into a WPF GUI view.
The image is an hbitmap constructed from a data structure of type boost::numeric::ublas::matrix. i.e. I start with a matrix of float values, then I create a HBITMAP, and then draw this HBITMAP using the device context of MFC. But now, I want to replace my MFC GUI with a WPF GUI, because it looks nicer. I plan to use C++/CLI to achieve the interop.
My question is as follows : How should I setup the transfer of my image across the interop boundary?
Should I transfer it over while it is still a structure of floats, or shall I transfer after I created the bitmap? I have heard marshaling is a big drain on efficiency, and so must be handled very carefully. Is there a type that is common to managed and native world, that can be used for this?
I am a complete newbie to interoping, any other related resources you share will be greatly appreciated.
Or, is there a way to completely avoid the transfer? - by drawing from native code into a WPF GUI view
My application is very performance sensitive, any alternative you suggest that achieves good performance will be greatly appreciated.
I've been through the same options and found that - at least for .NET 4.5 - the InteropBitmap is the best way to go, as long as your image stays the same size (e.g. for something like video streaming).
In brief, you create a memory mapped file (either in using C++/CLI or C# with p/invoke), and use that as the source of pixel data. The InteropBitmap is created over that same memory mapped file, and you can use it as an ImageSource in WPF.
In my application, a background thread updates the MMF and invalidates the InteropBitmap and the WPF front end just binds to the image source as normal.

WPF 3D Tutorial and example for Blend

i'm attempting to create a 3D dice control .
i'm having a hard time finding good tutorial's or source code on WPF 3D with 3D animations
preferably for Blend .
additionally are there any known tools for creating 3D templates with the corresponding triggers and animations which i could use to create a clickable interactive dice for my application .
though this question is quite general i still think it appropriate since materials on this particular subject seems to be hard to come by .
thanks in advance.
A while back i found a very good example here And also, you might want to see helix toolkit it works independent of WPF

Need example of Flex or silverlight application that enables interactive drawing on a video

I am trying to evaluate which technology is best for my needs.
I need to display a video I get from some remote device, and let a user
interactively draw on it lines, polygons etc.
I searched and couldn't find any existing applications with this ability
(all the flash applications only displayed video).
Could anyone point me to such an application?
I haven't seen a specific app that allows you to do that, but I can tell you it would be fairly trivial to build it in Flex. You would simply create a transparent Sprite over the video clip, then use the Drawing API bound to various mouse events to do your drawing.
The final image can be saved by using BitmapData.draw() over the container that holds both the video and the canvas, and you can pass a bytearray encoded as PNG or JPG to a server-side script to save it.
I can't speak to Silverlight as I've never used it - but a Flex dev could build a basic sample of this for you in Flex in about 20 mins just as a proof of concept.
Where does your expertise lie?
Silverlight you could knock up a proof of concept rather easily and as Myk points out you could do the same in Flex. So your best bet is really whichever technology your current expertise lies in.
In Silverlight you could use a InkPresenter control above a MediaElement control in about 2 minutes up and running with a video file.
I think the hard part is finding a way to display realtime video from your specific device.
Silverlight supports streaming video so having that device talk with Windows Media Server or Silverlight Streaming sounds like the best bet.
Julie Lerman wrote an Silverlight app that you can draw on Images:
http://thedatafarm.com/blog/tablet/drawing-in-silverlight-article-in-msdn-magazine/
the article was presented at a magazine:
http://msdn.microsoft.com/en-us/magazine/cc721604.aspx
Hopes this helps.

Learning WPF... Full screen launcher app

I'm in the process of building a Home Theatre PC (HTPC), and figured this could give me a small project to learn some more about WPF.
I want to build a simple program launcher. It would be an application that would fill the screen with a background of my choosing, and a few large icons/buttons to represent applications. I have an IR remote that will be set up to emulate keystrokes, so I can use the "keyboard" to move between the large buttons and "click" one of them, launching a program.
I'd like to define my button info, images, and background using some kind of external config file and image files in the same folder as the exe.
I've been playing around with the idea in VS2008 using VB but already I'm getting stuck with just trying to get an external image file to appear on a button. Many of the samples I find are relatively complicated and are written in C#, but I work in VB. If anyone has suggestions for getting over this hurdle or ideas on how I should approach other parts of my application, your input is welcome.
Thanks!
Try working your way through this series:
A First Introduction to WPF and XAML for Visual Basic Programmers
Good intro recommended in the first answer - if you want to go a bit deeper have a look at WPF - how and why

Resources