Lets say I have a black and white .jpeg image. How could I change the white pixels in the jpeg image to red using the hexidecimal format (ie going from #FFFFFFFF to #FFFF4F4B)?
You could also use a Pixel Shader Bitmap Effect.
Here is a similar example.
if you are using silverlight 3 then you should look at WriteableBitmap
here is a sample
Related
I have a Silverlight application wherein I want to convert colored TIFF image with LZW compression into black and white image with CCITT4 compression.
There is a sample that shows how to Convert System.Drawing.Bitmap to a black and white TIFF.
You should get what you want if you combine the sample above with the answer that shows how to convert a Silverlight image to bytes.
I have an image, I want to get a pixel color, replace a pixel color with another, and other operations on pixels.
Is there a way to do that? And what libraries are needed?
Have a look at the WriteableBitmapEx library. This will allow you to manipulate pixels directly.
Does anyone know how to apply brightness and contrast control to an Image in silverlight 5? Maybe using UIElement.Effect? I don't need to modify/save the image, just change how it is displayed.
Use a WriteableBitmap as source for your image and then apply a brightness/contrast formula on every pixel of the WriteableBitmap.
You need to call Invalidate() on your bitmap instance after you have changed the pixels.
I ended up using a Custom Pixel Shader. Shazzam has a contrast adjust custom pixel shader in it's pre-installed samples. The beauty of this is that it works in both WPF and silverlight.
Is there any way to get pixel RGB in silverlight? I have a PNG image which I'm going to find RGB and alpha of some pixels (I'm going to display ARGB of mouse position on image)
Seems like Bitmap.GetPixel (MSDN) would be a good place to start
I have a problem. I need to fill (or repaint) some pixels at image, stored in Image control. This is a png image. I mean, that all black pixels should be filled with, for example, red color. How can I do this? I thought I can access directly to pixels and using XOR change special bits, but I don't know how to do this. Or maybe there is an easier way?
The GetPixel and SetPixel methods should work for what you need.
This answer has a code sample that you should be able to adopt for your use.