PixelMaker Project

It was another of my projects I envisioned for some time now. The idea behind is creating my own pixel art maker

The code below is a sort "proof of concept" piece that is placed and run directly on a new WPF project. Nothing fancy here, no MVVM, no error handlings. 
The project will start once I complete the flowchart describing the whole thing. The flowchart will mainly describe the UI interactions. It is a flow of the program how I imagine it should work. The flowchart will be an overview plan, rather than a detailed plan. 
So let us have a look at the code:
You will have to read through the code and comments to understand it.

FileInfo file = new FileInfo("Images/beacon.jpg"); //This is to get hold of the file. Keep in mind, this line will be replaced with a user input method

Bitmap bitmap = new Bitmap(file.FullName);//the bitmap image object 

System.Drawing.Color pixelColor = bitmap.GetPixel(bitmap.Width - 10, bitmap.Height - 10);//this part will also change later to support dynamic data processing
System.Windows.Media.Color color = System.Windows.Media.Color.FromArgb(pixelColor.A, pixelColor.R, pixelColor.G, pixelColor.B);//the color object to feed to the brush below

SolidColorBrush brush = new SolidColorBrush(color);//brush uses the color to do the paint job
box.Fill = brush;//this is a fixed XAML element. The actual implementation may require a different approach

 

See you soon

Add ping

Trackback URL : https://created.link/index.php?trackback/27

Page top