Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

c# wpf bitmap/jpeg pixel array manipulation

$
0
0

Hi, 

I have created a wpf project in VS and have made something similar to a paint program. Now I want to save the drawings. I have found online sample codes using rendertargetbitmap and pngbitmapencoder. that grabs the children from the canvas and save the canvas as a bitmap/png image.

It works fine. But if i use jpepbitmapencoder / bmpbitmapencoder, there is a boundary on the left and top but not at the right and bottom. 

And I want to apply sobel edge detection to the picture that I have saved. I have done the grayscale part. But it seems that there are 4 bytes per pixel. I want to know how to make them 1 byte per pixel or something to save memory and stuff. 

Thanks in advance.

Regards

Valdarhett


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>