private void draw_chunky_pixel(int x, int y, Graphics.Pen pen) { for (int y_delta = y; y_delta <= y + 3; y_delta++) { for (int x_delta = x; x_delta <= x + 3; x_delta++) { Graphics.Point pixel = new Graphics.Point(x_delta, y_delta); screen.DrawPoint(pen, pixel); } } }
//Draw Filled Rectangle public static void DrawFilledRectangle(CGS.Pen color, CGS.Point position, int width, int height) { if (GraphicsInitialised()) { aCanvas.DrawFilledRectangle(color, position, width, height); } else { InitialiseGraphics(); DrawFilledRectangle(color, position, width, height); } }
public static void DrawRectangle(CGS.Pen pen, int x, int y, int width, int height) { if (GraphicsInitialised()) { aCanvas.DrawRectangle(pen, x, y, width, height); } else { InitialiseGraphics(); DrawRectangle(pen, x, y, width, height); } }
protected override void Run() { //for (int i = 0; i < 256; i++) //Color c = Color.Red; //VScreen.SetPixel(69, 69, 0xFF0000); //VScreen.SetPixel(69, 69, c.G, c.R, c.B); Pen pen = new Pen(Color.Blue); canvas.DrawPoint(pen, 69, 69); Console.ReadKey(); TestController.Completed(); }
public static void DrawFilledRectangle(Color color, int x, int y, int width, int height) { if (GraphicsInitialised() == true) { CGS.Pen pen = new CGS.Pen(color); aCanvas.DrawFilledRectangle(pen, x, y, width, height); } else { InitialiseGraphics(); DrawFilledRectangle(color, x, y, width, height); } }
public static void DrawRectangle(Color color, CGS.Point position, int width, int height) { if (GraphicsInitialised()) { CGS.Pen pen = new CGS.Pen(color); aCanvas.DrawRectangle(pen, position, width, height); } else { InitialiseGraphics(); DrawRectangle(color, position, width, height); } }
//Clear public static void Clear(Color color) { if (GraphicsInitialised() == true) { CGS.Pen pen = new CGS.Pen(color); aCanvas.DrawFilledRectangle(pen, new CGS.Point(0, 0), aCanvas.Mode.Rows, aCanvas.Mode.Columns); } else { InitialiseGraphics(); Clear(color); } }
public void demo(string[] maincommand) { Init(); Graphics.Pen pen; int colour = 0; //colour squares for (int v = 0; v <= 2; v += 1) { for (int w = 0; w <= 2; w += 1) { for (int y = 0; y <= 254; y += 3) { for (int x = 0; x <= 254; x += 3) { Color pixelcolour = new Color(); pixelcolour = Color.FromArgb(x, y, 44 * (v + w)); pen = new Graphics.Pen(pixelcolour); draw_chunky_pixel(x + 260 * w, y + 260 * v, pen); colour++; if (colour == 3) { colour = 0; } } } } } //eyes screen.Clear(); pen = new Graphics.Pen(Color.White); for (int y = 50; y <= 700; y += 42) { for (int x = 100; x <= 1000; x += 102) { Graphics.Point pixel = new Graphics.Point(x, y); for (int i = 20; i <= 50; i += 3) { screen.DrawEllipse(pen, pixel, i, 20); } } } //triangles screen.CreateCursor(); screen.SetCursor(true, 200, 300); }
public override void DrawPoint(Pen pen, float x, float y) { throw new NotImplementedException(); }
public override void DrawPoint(Pen pen, int x, int y) { int where = x * ((int)mode.ColorDepth / 8) + y * (mode.Columns * ((int)mode.ColorDepth / 8)); /* * The old VBEScreen used directly the RGB colors ignoring the selected ColorDepth I don't think this is correct * for now we can Draw only if the ColorDepth is 32 bit, we will throw otherwise */ switch (ColorDepth.ColorDepth32) { case ColorDepth.ColorDepth32: VBEDriver.SetVRAM((uint)where, pen.Color.B); // BLUE VBEDriver.SetVRAM((uint)where + 1, pen.Color.G); // GREEN VBEDriver.SetVRAM((uint)where + 2, pen.Color.R); // RED break; default: throw new NotImplementedException(); } }