writeablebitmap

WriteableBitmap unavailable?

I've discovered what may be the perfect answer to a question on buffered drawing, but for some reason my version of VS2008 doesn't seem to have a WriteableBitmap? I've tried including the relevent namespaces as per the documentation: using namespace System::Windows::Media; using namespace System::Windows::Media::Imaging; But that just...

Using FJCore to encode Silverlight WriteableBitmap

I am trying to find out how to use FJCore to encode a WriteableBitmap to a jpeg. I understand that WriteableBitmap provides the raw pixels but I am not sure how to convert it to the format that FJCore expects for its JpegEncoder method. JpegEncoder has two overloads, one takes a FluxJpeg.Core.Image and the other takes in a DecodedJpeg. ...

WPF WriteableBitmap Memory Leak?

Hello, everyone! I'm trying to figure out how to release a WriteableBitmap memory. In the next section of code I fill the backbuffer of a WriteableBitmap with a really large amount of data from "BigImage" (3600 * 4800 px, just for testing) If I comment the lines where bitmap and image are equaled to null, the memory it´s not release an...

How to dispose a Writeable Bitmap? (WPF)

Some time ago i posted a question related to a WriteableBitmap memory leak, and though I received wonderful tips related to the problem, I still think there is a serious bug / (mistake made by me) / (Confusion) / (some other thing) here. So, here is my problem again: Suppose we have a WPF application with an Image and a button. The ima...

WPF WriteableBitmap and effects

Im trying to look into using the WPF WriteableBitmap class to allow my application to apply an opacity mask to an image. Basically I have a blue rectangle as an image, and another 100% transparent green rectangle image over the top of the blue one. When the user moves their mouse over the green (transparent) image, I want to apply the ...

Creating high performance animations in WPF

Hi All, I'm in a situation that requires many animations with effects like transparency to be applied but when there are about 10 of them running, my application slows down to a grinding halt! :( I also, tried implementing a particle like effect using a frame by frame manual animation using the CompositionTarget.Rendering event, which ...

How to deal with Transparent part in page

it is black now ...

where did PixelFormats and WriteableBitmap.Lock go in Silverlight3?

A few months ago I built some online samples like this one from Jeff Prosise that use the WriteableBitmap class in Silverlight. Revisiting them today with the latest Silverlight3 installer (3.0.40624.0), the API seems to have changed. I figured out some of the changes. For example, the WriteableBitmap array accessor has disappeared,...

Asynchronous operations on WriteableBitmap

I'm writing an application in WPF (C#) which does long operations on a collection of Bitmaps. To keep my application responsive, I decided to use another thread to perform the operations on bitmaps and report progress on a progressbar in main UI thread. I thought BackgroundWorker would do anything for me, but looks like it won't be that ...

Pixelvalues turn up negative

I want to save a writableimage in Silverlight to disk. I found this tutorial : http://kodierer.blogspot.com/2009/11/convert-encode-and-decode-silverlight.html, and have based my code on the EncodeJpeg method. But at the: pixelsForJpeg[0][x, y] = (byte)(color >> 16); it throws an exception : Arithmetic operation resulted in an over...

Overlay WriteableBitmap with color

I'm trying to overlay a WriteableBitmap with a certain color in Silverlight. I have a black and white base image, which I'm using to create smaller WriteableBitmap images for a new composite image and I want to overlay either the black or white part of the source image cut-out with a certain color before adding it to the composite image....

In WebBrowser control get Silverlight Canvas

I have a webbrowser control that loads an html page which contains a silverlight object. I want to use the webbrowser control to get the silverlight canvas so that I can pass it to a WriteableBitmap() object. The silverlight is being loaded into a div called SilverlightHostControl and I am trying to get it like this in C#: object elem...

Wpf: Why is WriteableBitmap getting slower?

There is a simple MSDN example about WriteableBitmap. It shows how to draw a freehand line with the cursor by just updating one pixel when the mouse is pressed and is moving over a WPF -Image Control. writeableBitmap.Lock(); (...set the writeableBitmap.BackBuffers pixel value...) writeableBitmap.AddDirtyRect(new Int32Rect(column, ...

Using gdi+ with InteropBitmap

Is it possible to use WPF's InteropBitmap together with gdi+ ? Any examples ? (I need it for 2D drawing, many small objects; I know how to use gdi+ with WriteableBitmap => (see post by Danko) , but after all I've read InteropBitmap should be faster) fritz ...

Why is my unsafe code block slower than my safe code?

I am attempting to write some code that will expediently process video frames. I am receiving the frames as a System.Windows.Media.Imaging.WriteableBitmap. For testing purposes, I am just applying a simple threshold filter that will process a BGRA format image and assign each pixel to either be black or white based on the average of th...

Drawing line using WPF WriteableBitmap.BackBuffer

Do you know any library that provides methods to draw simple shapes (lines and optionally other shapes) using WPF WriteableBitmap and ideally BackBuffer? I know that there is a WriteableBitmapEx project for silverlight but is there WPF equivalent? ...

WriteableBitmap in .NET 4

Hi there, I have got a problem: I would like to use a method Render() for WriteableBitmap object. However, as I noticed, the method is not available without using a Silverlight assembly System.Windows.dll. I need to use RenderTargetBitmap in my project (PresentationCore assembly for standard .net). Here is the problem - there are defini...

How do I disable silverlight cross-domain content protection for WriteableBitmap

Hi all, I have an Esri map in silverlight and I am trying to get a screenshot. However, I am facing cross-domain content protection for writeablebitmap, saying "Pixels are not accessible". Is there a way that I can disable this? or any other work around in silverlight 3 or 4? ...

Silverlight: converting WriteableBitmap to stream

Given a WriteableBitmap, how can I save the bitmap back into an image stream (JPG or BMP)? My scenario is: Show OpenFileDialog, let user select image Load image into WriteableBitmap Resize image Send image stream to web service Step #4 is what I'm having trouble with. How can I go from WriteableBitmap -> Stream? ...

WPF/WinForms/GDI interop: converting a WriteableBitmap to a System.Drawing.Image?

How can I convert a WPF WriteableBitmap object to a System.Drawing.Image? My WPF client app sends bitmap data to a web service, and the web service needs to construct a System.Drawing.Image on that end. I know I can get the data of a WriteableBitmap, send the info over to the web service: // WPF side: WriteableBitmap bitmap = ...; in...