Have you ever tried to create bitmap images with c# ?
Reading or writing pixels is very very easy...
Each pixel has RGBA value that can you can read or write.
R : the Red component of the pixel
G : the Green component of the pixel
B : the Blue component of the pixel
A : the Alpha (transparency level) component of the pixel
Each component can have a value between 0 and 255 in decimal (base 10) and between 00 and FF in hexadecimal (base 16).
This sample code use simple math function to calculate random colors for pixels.
You can move the slider to apply a multiply factor to animate the generated bitmap.
This is a really simple sample but you can quite easily apply filters or draw fractals for exemple !
You can download the source code of this sample project (VS2012 / C#)
WpfArtWithMath.zip
0 comments:
Post a Comment