Presentation Framework Imaging Classes Gray-Scale Example (loading, drawing, encoding)


/ Published in: C#
Save to your folder(s)

You must include these DLL references in your vsweb or vscode project:\r\nPresentationCore,\r\nPresentationFramework,\r\nWindowsBase. \r\nNotice how I am manipulating the RGB values of each pixel, this is the power of these classes. The Drawing classes have the pixel drawing capabilities to draw lines and such already written for you, but handling a grayscale byte for byte is faster than relying on their other classes. I also chose to load and encode as PNG, but they have loaders and encoders for other file types as well that work the same way.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.