internal async Task DrawImageAsyncInternal(EV3Color color, ushort x, ushort y, string devicePath) { Command c = new Command(CommandType.DirectNoReply); c.DrawImage(color, x, y, devicePath); await _brick.SendCommandAsyncInternal(c); }
internal async Task DrawDottedLineAsyncInternal(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1, ushort onPixels, ushort offPixels) { Command c = new Command(CommandType.DirectNoReply); c.DrawDottedLine(color, x0, y0, x1, y1, onPixels, offPixels); await _brick.SendCommandAsyncInternal(c); }
internal async Task DrawTextAsyncInternal(EV3Color color, ushort x, ushort y, string text) { Command c = new Command(CommandType.DirectNoReply); c.DrawText(color, x, y, text); await _brick.SendCommandAsyncInternal(c); }
internal async Task DrawFillWindowAsyncInternal(EV3Color color, ushort y0, ushort y1) { Command c = new Command(CommandType.DirectNoReply); c.DrawFillWindow(color, y0, y1); await _brick.SendCommandAsyncInternal(c); }
internal async Task DrawCircleAsyncInternal(EV3Color color, ushort x, ushort y, ushort radius, bool filled) { Command c = new Command(CommandType.DirectNoReply); c.DrawCircle(color, x, y, radius, filled); await _brick.SendCommandAsyncInternal(c); }
internal async Task DrawRectangleAsyncInternal(EV3Color color, ushort x, ushort y, ushort width, ushort height, bool filled) { Command c = new Command(CommandType.DirectNoReply); c.DrawRectangle(color, x, y, width, height, filled); await _brick.SendCommandAsyncInternal(c); }
internal async Task DrawPixelAsyncInternal(EV3Color color, ushort x, ushort y) { Command c = new Command(CommandType.DirectNoReply); c.DrawPixel(color, x, y); await _brick.SendCommandAsyncInternal(c); }
/// <summary> /// Append the Draw Pixel command to an existing Command object /// </summary> /// <param name="color">Color of the pixel</param> /// <param name="x">X position</param> /// <param name="y">Y position</param> public void DrawPixel(EV3Color color, ushort x, ushort y) { AddOpcode(Opcode.UIDraw_Pixel); AddParameter((byte)color); AddParameter(x); AddParameter(y); }
/// <summary> /// Append the Draw Fill Window command to an existing Command object /// </summary> /// <param name="color">The color to fill</param> /// <param name="y0">Y start</param> /// <param name="y1">Y end</param> public void DrawFillWindow(EV3Color color, ushort y0, ushort y1) { AddOpcode(Opcode.UIDraw_FillWindow); AddParameter((byte)color); AddParameter(y0); AddParameter(y1); }
private Port.Colors ConvertEV3ColorToPortColor(EV3Color color) { switch (color) { case EV3Color.Black: return(Port.Colors.BLACK); case EV3Color.Blue: return(Port.Colors.BLUE); case EV3Color.Brown: return(Port.Colors.ORANGE); case EV3Color.Green: return(Port.Colors.GREEN); case EV3Color.Red: return(Port.Colors.RED); case EV3Color.White: return(Port.Colors.WHITE); case EV3Color.Yellow: return(Port.Colors.YELLOW); } return(Port.Colors.NONE); }
internal async Task DrawLineAsyncInternal(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1) { Command c = new Command(CommandType.DirectNoReply); c.DrawLine(color, x0, y0, x1, y1); await _brick.SendCommandAsyncInternal(c); }
DrawLineAsync(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1) { return(DrawLineAsyncInternal(color, x0, y0, x1, y1) #if WINRT .AsAsyncAction() #endif ); }
DrawImageAsync(EV3Color color, ushort x, ushort y, string devicePath) { return(DrawImageAsyncInternal(color, x, y, devicePath) #if WINRT .AsAsyncAction() #endif ); }
DrawFillWindowAsync(EV3Color color, ushort y0, ushort y1) { return(DrawFillWindowAsyncInternal(color, y0, y1) #if WINRT .AsAsyncAction() #endif ); }
DrawDottedLineAsync(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1, ushort onPixels, ushort offPixels) { return(DrawDottedLineAsyncInternal(color, x0, y0, x1, y1, onPixels, offPixels) #if WINRT .AsAsyncAction() #endif ); }
DrawTextAsync(EV3Color color, ushort x, ushort y, string text) { return(DrawTextAsyncInternal(color, x, y, text) #if WINRT .AsAsyncAction() #endif ); }
DrawRectangleAsync(EV3Color color, ushort x, ushort y, ushort width, ushort height, bool filled) { return(DrawRectangleAsyncInternal(color, x, y, width, height, filled) #if WINRT .AsAsyncAction() #endif ); }
DrawPixelAsync(EV3Color color, ushort x, ushort y) { return(DrawPixelAsyncInternal(color, x, y) #if WINRT .AsAsyncAction() #endif ); }
DrawCircleAsync(EV3Color color, ushort x, ushort y, ushort radius, bool filled) { return(DrawCircleAsyncInternal(color, x, y, radius, filled) #if WINRT .AsAsyncAction() #endif ); }
/// <summary> /// Append the Draw Image command to an existing Command object /// </summary> /// <param name="color">The color of the image to draw</param> /// <param name="x">X position</param> /// <param name="y">Y position</param> /// <param name="devicePath">Filename on the brick of the image to draw</param> public void DrawImage(EV3Color color, ushort x, ushort y, string devicePath) { AddOpcode(Opcode.UIDraw_BmpFile); AddParameter((byte)color); AddParameter(x); AddParameter(y); AddParameter(devicePath); }
/// <summary> /// Append the Draw Text command to an existing Command object /// </summary> /// <param name="color">Color of the text</param> /// <param name="x">X position</param> /// <param name="y">Y position</param> /// <param name="text">Text to draw</param> public void DrawText(EV3Color color, ushort x, ushort y, string text) { AddOpcode(Opcode.UIDraw_Text); AddParameter((byte)color); AddParameter(x); AddParameter(y); AddParameter(text); }
/// <summary> /// Append the Draw Circle command to an existing Command object /// </summary> /// <param name="color">Color of the circle</param> /// <param name="x">X position</param> /// <param name="y">Y position</param> /// <param name="radius">Radius of circle</param> /// <param name="filled">Draw a filled or empty circle</param> public void DrawCircle(EV3Color color, ushort x, ushort y, ushort radius, bool filled) { AddOpcode(filled ? Opcode.UIDraw_FillCircle : Opcode.UIDraw_Circle); AddParameter((byte)color); AddParameter(x); AddParameter(y); AddParameter(radius); }
/// <summary> /// Append the Draw Line command to an existing Command object /// </summary> /// <param name="color">Color of the line</param> /// <param name="x0">X start</param> /// <param name="y0">Y start</param> /// <param name="x1">X end</param> /// <param name="y1">Y end</param> public void DrawLine(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1) { AddOpcode(Opcode.UIDraw_Line); AddParameter((byte)color); AddParameter(x0); AddParameter(y0); AddParameter(x1); AddParameter(y1); }
/// <summary> /// Append the Draw Rectangle command to an existing Command object /// </summary> /// <param name="color">Color of the rectangle</param> /// <param name="x">X position</param> /// <param name="y">Y position</param> /// <param name="width">Width of rectangle</param> /// <param name="height">Height of the rectangle</param> /// <param name="filled">Draw a filled or empty rectangle</param> public void DrawRectangle(EV3Color color, ushort x, ushort y, ushort width, ushort height, bool filled) { AddOpcode(filled ? Opcode.UIDraw_FillRect : Opcode.UIDraw_Rect); AddParameter((byte)color); AddParameter(x); AddParameter(y); AddParameter(width); AddParameter(height); }
/// <summary> /// Append the Draw Dotted Line command to an existing Command object /// </summary> /// <param name="color">The color of the line</param> /// <param name="x0">X start</param> /// <param name="y0">Y start</param> /// <param name="x1">X end</param> /// <param name="y1">Y end</param> /// <param name="onPixels">Number of pixels the line is on</param> /// <param name="offPixels">Number of pixels the line is off</param> public void DrawDottedLine(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1, ushort onPixels, ushort offPixels) { AddOpcode(Opcode.UIDraw_DotLine); AddParameter((byte)color); AddParameter(x0); AddParameter(y0); AddParameter(x1); AddParameter(y1); AddParameter(onPixels); AddParameter(offPixels); }