Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Bitmap/C-sharp/bitmap.cs
Normal file
32
Task/Bitmap/C-sharp/bitmap.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
public class Bitmap
|
||||
{
|
||||
public struct Color
|
||||
{
|
||||
public byte Red { get; set; }
|
||||
public byte Blue { get; set; }
|
||||
public byte Green { get; set; }
|
||||
}
|
||||
Color[,] _imagemap;
|
||||
public int Width { get { return _imagemap.GetLength(0); } }
|
||||
public int Height { get { return _imagemap.GetLength(1); } }
|
||||
public Bitmap(int width, int height)
|
||||
{
|
||||
_imagemap = new Color[width, height];
|
||||
}
|
||||
public void Fill(Color color)
|
||||
{
|
||||
for (int y = 0; y < Height; y++)
|
||||
for (int x = 0; x < Width; x++)
|
||||
{
|
||||
_imagemap[x, y] = color;
|
||||
}
|
||||
}
|
||||
public Color GetPixel(int x, int y)
|
||||
{
|
||||
return _imagemap[x, y];
|
||||
}
|
||||
public void SetPixel(int x, int y, Color color)
|
||||
{
|
||||
_imagemap[x, y] = color;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue