public void RunOnce(IRenderGDI aPort) { aPort.SetBkMode((int)BackgroundMixMode.TRANSPARENT); aPort.SetTextColor(RGBColor.Red); aPort.DrawString(200, 200, "Hello World"); aPort.Flush(); }
public void RunOnce(IRenderGDI aPort) { int i; int cxClient = fSize.cx; int cyClient = fSize.cy; Point[] points = new Point[fNumSegments]; aPort.SaveState(); aPort.SetDefaultPenColor(RGBColor.Red); aPort.MoveTo(0, cyClient / 2); aPort.LineTo(cxClient, cyClient / 2); aPort.SetDefaultPenColor(RGBColor.Black); for (i = 0; i < fNumSegments; i++) { points[i].x = i * cxClient / fNumSegments; points[i].y = (int)(((double)cyClient/2.0f)*(1.0f-Math.Sin(Math.PI*2.0f*(double)i/(double)fNumSegments))); } aPort.PolyLine(points); aPort.RestoreState(); }
public void RunOnce(IRenderGDI aPort) { Rectangle[] rects = new Rectangle[4]; rects[0] = new Rectangle(0, 10, 40, 200); rects[1] = new Rectangle(60, 10, 40, 300); rects[2] = new Rectangle(120, 10, 40, 150); rects[3] = new Rectangle(180, 10, 40, 400); aPort.SaveState(); // Select a gray brush to draw with aPort.UseDefaultBrush(); aPort.UseDefaultPen(); aPort.SetDefaultBrushColor(RGBColor.DarkGreen); aPort.SetDefaultPenColor(RGBColor.Red); // Flip the coordinate system so 0,0 is in the lower left aPort.SetMappingMode(MappingModes.LOENGLISH); aPort.SetViewportOrigin(0, fSize.cy); aPort.Flush(); for (int i = 0; i < 4; i++) { aPort.Rectangle(rects[i]); } aPort.Flush(); aPort.RestoreState(); }
public void RunOnce(IRenderGDI aPort) { Point[] points = new Point[10]; for (int i = 0; i < 10; i++) { points[i].x = fSize.cx * fFigure[i].x / 200; points[i].y = fSize.cy * fFigure[i].y / 100; } // Select a gray brush to draw with aPort.SelectStockObject(GDI32.GRAY_BRUSH); // First draw with ALTERNATE method aPort.SetPolyFillMode(GDI32.ALTERNATE); aPort.Polygon(points); // Translate the x coordinates by half the screen for (int i = 0; i < 10; i++) { points[i].x += fSize.Width / 2; } // Now draw with WINDING method aPort.SetPolyFillMode(GDI32.WINDING); aPort.Polygon(points); }
public void RunOnce(IRenderGDI aPort) { aPort.SaveState(); aPort.UseDefaultBrush(); aPort.UseDefaultPen(); aPort.SetDefaultBrushColor(RGBColor.Pink); aPort.SetDefaultPenColor(RGBColor.Red); aPort.Flush(); for (int coord = 10; coord < fSize.Height; coord += 50) { aPort.Rectangle(coord, coord, coord + 200, coord + 200); } aPort.RestoreState(); }
public void RunOnce(IRenderGDI aPort) { aPort.SaveState(); aPort.SetDefaultPenColor(RGBColor.Black); aPort.UseDefaultPen(); aPort.SetMappingMode(MappingModes.TEXT); aPort.PolyBezier(fFigure); // Draw the control lines aPort.SetDefaultPenColor(RGBColor.Red); aPort.MoveTo(fFigure[0]); aPort.LineTo(fFigure[1]); aPort.MoveTo(fFigure[2]); aPort.LineTo(fFigure[3]); aPort.Flush(); aPort.RestoreState(); }
public void RunOnce(IRenderGDI aPort) { int cxClient = fSize.cx; int cyClient = fSize.cy; aPort.SaveState(); aPort.Flush(); aPort.SetMappingMode(MappingModes.LOENGLISH); aPort.UseDefaultPen(); aPort.UseDefaultBrush(); aPort.SetDefaultBrushColor(RGBColor.Blue); aPort.SetDefaultPenColor(RGBColor.Yellow); aPort.Flush(); aPort.Rectangle(cxClient / 8, cyClient / 8, (7 * cxClient / 8), (7 * cyClient / 8)); Pen aPen = aPort.CreatePen(GDI32.PS_DASHDOTDOT, 1, RGBColor.Blue, Guid.NewGuid()); aPort.SetPen(aPen); aPort.MoveTo(0, 0); aPort.LineTo(cxClient, cyClient); aPort.MoveTo(0, cyClient); aPort.LineTo(cxClient, 0); aPort.Ellipse(cxClient / 8, cyClient / 8, (7 * cxClient / 8), (7 * cyClient / 8)); aPort.RoundRect(cxClient / 4, cyClient / 4, 3 * cxClient / 4, 3 * cyClient / 4, cxClient / 4, cyClient / 4); aPort.RestoreState(); }
public GDICommandRecipient(GDIGeometryRenderer renderTo) { fRenderer = renderTo; }
public Command_Render(IRenderGDI graphPort) { fGraphPort = graphPort; }