SetMappingMode() public method

public SetMappingMode ( MappingModes aMode ) : void
aMode MappingModes
return void
Exemplo n.º 1
0
        public void RunOnce(GDIRenderer aPort)
        {

            aPort.SaveState();

            // Select a gray brush to draw with
            aPort.UseDefaultBrush();
            aPort.UseDefaultPen();

            aPort.SetDefaultBrushColor(RGBColor.DarkGreen);
            aPort.SetDefaultPenColor(RGBColor.Black);

            // Flip the coordinate system so 0,0 is in the lower left
            aPort.SetMappingMode(MappingModes.LoEnglish);
            //aPort.SetViewportOrigin(0, fSize.Width);
            aPort.ScaleTransform(1, -1);

            aPort.Flush();
            GDIPen rectPen = new GDICosmeticPen(PenStyle.Solid, RGBColor.Red, Guid.NewGuid());
            GDIBrush rectBrush = new GDISolidBrush(RGBColor.DarkCyan);
            for (int i = 0; i < 4; i++)
            {

                //aPort.DrawRectangle(rectPen, rects[i].Left, rects[i].Top, rects[i].Width, rects[i].Height);
                aPort.StrokeAndFillRectangle(rectPen, rectBrush, rects[i]);
            }

            aPort.Flush();
            aPort.ResetState();
        
        }
Exemplo n.º 2
0
        public void RunOnce(GDIRenderer aPort)
        {
            aPort.SaveState();

            // Orient the axis with origin at upper 
            // left hand corner, y-axis positive going down the screen
            aPort.SetMappingMode(MappingModes.Text);

            // Draw the curve
            aPort.DrawBeziers(fBlackPen, fFigure);

            // Draw the control lines
            // Control line 1
            aPort.DrawLine(fRedPen, new Point(fFigure[0].X, fFigure[0].Y), new Point(fFigure[1].X, fFigure[1].Y));

            // Control line 2
            aPort.DrawLine(fRedPen, new Point(fFigure[2].X, fFigure[2].Y), new Point(fFigure[3].X, fFigure[3].Y));

            aPort.Flush();
            aPort.ResetState();
        }