Ejemplo n.º 1
0
        public static void BasicTouchEventTest(
            NwazetGoImaging.VirtualCanvas canvas)
        {
            var message = "Touch Event Test";
            var fontInfo = new NwazetGoFonts.DejaVuSansBold9().GetFontInfo();
            var stringLength = fontInfo.GetStringWidth(message);

            canvas.DrawFill(ColorBackground);
            canvas.DrawString(
                (canvas.Width - stringLength) / 2, 150,
                (ushort)NwazetGoImaging.BasicColor.Black, fontInfo.ID, message);

            canvas.TouchscreenWaitForEvent();

            canvas.DrawCircleFilled(lastTouchX, lastTouchY, 4, (ushort)NwazetGoImaging.BasicColor.Red);
            canvas.Execute();

            Thread.Sleep(1000);
        }
Ejemplo n.º 2
0
 public static void RenderPrimitiveShapes(NwazetGoImaging.VirtualCanvas canvas)
 {
     canvas.DrawLine(5, 65, 200, 65, (ushort)NwazetGoImaging.BasicColor.Red);
     canvas.DrawLine(5, 67, 200, 67, (ushort)NwazetGoImaging.BasicColor.Green);
     canvas.DrawLine(5, 69, 200, 69, (ushort)NwazetGoImaging.BasicColor.Blue);
     canvas.DrawCircleFilled(30, 105, 23, (ushort)NwazetGoImaging.ColorHelpers.GetRGB24toRGB565(0x33, 0x00, 0x00));
     canvas.DrawCircleFilled(30, 105, 19, (ushort)NwazetGoImaging.ColorHelpers.GetRGB24toRGB565(0x66, 0x00, 0x00));
     canvas.DrawCircleFilled(30, 105, 15, (ushort)NwazetGoImaging.ColorHelpers.GetRGB24toRGB565(0x99, 0x00, 0x00));
     canvas.DrawCircleFilled(30, 105, 11, (ushort)NwazetGoImaging.ColorHelpers.GetRGB24toRGB565(0xCC, 0x00, 0x00));
     canvas.DrawCircleFilled(30, 105, 7, (ushort)NwazetGoImaging.ColorHelpers.GetRGB24toRGB565(0xFF, 0x00, 0x00));
     canvas.DrawRectangleFilled(80, 80, 180, 125, (ushort)NwazetGoImaging.GrayScaleValues.Gray_15);
     canvas.DrawRectangleFilled(85, 85, 175, 120, (ushort)NwazetGoImaging.GrayScaleValues.Gray_30);
     canvas.DrawRectangleFilled(90, 90, 170, 115, (ushort)NwazetGoImaging.GrayScaleValues.Gray_50);
     canvas.DrawRectangleFilled(95, 95, 165, 110, (ushort)NwazetGoImaging.GrayScaleValues.Gray_80);
     canvas.DrawRectangleFilled(100, 100, 160, 105, (ushort)NwazetGoImaging.GrayScaleValues.Gray_128);
 }