Exemplo n.º 1
0
 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;
             }
         }
     }
 }
Exemplo n.º 2
0
 public void Resize(Size size)
 {
     _position = new Rectangle(_position.TopLeft, _position.TopLeft.Plus(size));
 }
Exemplo n.º 3
0
 public void MoveTo(Point absolute)
 {
     _position = _position.MoveTo(absolute);
 }
Exemplo n.º 4
0
 public Window()
 {
     _position = new Rectangle(Point.Zero, Point.Zero);
 }
Exemplo n.º 5
0
 public Box(Rectangle rectangle, uint color)
 {
     _rectangle = rectangle;
     _color = color;
 }
Exemplo n.º 6
0
 public BitmapRenderer(Bitmap target)
 {
     _bitmap = target;
     _target = Source;
     _clip = Source;
 }