public unsafe void Draw(Rectangle rectangle, uint color) { var r = rectangle.Scale(Source, Target); fixed (byte* raw = _bitmap.Pixels) { for (int y = (int)r.TopLeft.Y; y < (int)r.BottomRight.Y; y++) { int start = (int)r.TopLeft.X; int end = (int)r.BottomRight.X; int begin = _bitmap.Index(start, y); var pixels = (uint*)(raw + begin); int cnt = 0; for (int x = start; x < end; x++) { pixels[cnt++] = color; } } } }
public void Resize(Size size) { _position = new Rectangle(_position.TopLeft, _position.TopLeft.Plus(size)); }
public void MoveTo(Point absolute) { _position = _position.MoveTo(absolute); }
public Window() { _position = new Rectangle(Point.Zero, Point.Zero); }
public Box(Rectangle rectangle, uint color) { _rectangle = rectangle; _color = color; }
public BitmapRenderer(Bitmap target) { _bitmap = target; _target = Source; _clip = Source; }