NewTOAPIA.Drawing.GraphPortDelegate.AddGraphPort C# (CSharp) Méthode

AddGraphPort() public méthode

public AddGraphPort ( IGraphPort aPort ) : void
aPort IGraphPort
Résultat void
        public void AddGraphPort(IGraphPort aPort)
        {
            SetPixelHandler += new NewTOAPIA.Drawing.SetPixel(aPort.SetPixel);

            DrawLineHandler += new DrawLine(aPort.DrawLine);
            DrawLinesHandler += new DrawLines(aPort.DrawLines);

            DrawRectangleHandler += new NewTOAPIA.Drawing.DrawRectangle(aPort.DrawRectangle);
            DrawRectanglesHandler += new NewTOAPIA.Drawing.DrawRectangles(aPort.DrawRectangles);
            FillRectangleHandler += new NewTOAPIA.Drawing.FillRectangle(aPort.FillRectangle);

            DrawEllipseHandler += new NewTOAPIA.Drawing.DrawEllipse(aPort.DrawEllipse);
            FillEllipseHandler += new NewTOAPIA.Drawing.FillEllipse(aPort.FillEllipse);

            DrawRoundRectHandler += new NewTOAPIA.Drawing.DrawRoundRect(aPort.DrawRoundRect);

            PolygonHandler += new NewTOAPIA.Drawing.Polygon(aPort.Polygon);
            DrawBeziersHandler += new NewTOAPIA.Drawing.DrawBeziers(aPort.DrawBeziers);
            
            DrawPathHandler += new NewTOAPIA.Drawing.DrawPath(aPort.DrawPath);
            FillPathHandler += new FillPath(aPort.FillPath);

            //// Gradient fills
            //DrawGradientRectangleHandler += new NewTOAPIA.Drawing.DrawGradientRectangle(aPort.DrawGradientRectangle);

            //// Drawing Text
            DrawStringHandler += new NewTOAPIA.Drawing.DrawString(aPort.DrawString);

            ///// Draw bitmaps
            PixBltHandler += new NewTOAPIA.Drawing.PixBlt(aPort.PixBlt);
            //PixmapShardBltHandler += new NewTOAPIA.Drawing.PixmapShardBlt(aPort.PixmapShardBlt);
            //AlphaBlendHandler += new NewTOAPIA.Drawing.AlphaBlend(aPort.AlphaBlend);

            // Path handling
            //DrawPathHandler += new NewTOAPIA.Drawing.DrawPath(aPort.DrawPath);
            //SetPathAsClipRegionHandler += new NewTOAPIA.Drawing.SetPathAsClipRegion(aPort.SetPathAsClipRegion);

            //// Setting some objects
            SetPenHandler += new NewTOAPIA.Drawing.SetPen(aPort.SetPen);
            SetBrushHandler += new SetBrush(aPort.SetBrush);
            SetFontHandler += new SetFont(aPort.SetFont);

            //SelectStockObjectHandler += new NewTOAPIA.Drawing.SelectStockObject(aPort.SelectStockObject);
            SelectUniqueObjectHandler += new NewTOAPIA.Drawing.SelectUniqueObject(aPort.SelectUniqueObject);

            //// State Management
            FlushHandler += new NewTOAPIA.Drawing.Flush(aPort.Flush);
            SaveStateHandler += new NewTOAPIA.Drawing.SaveState(aPort.SaveState);
            ResetStateHandler += new NewTOAPIA.Drawing.ResetState(aPort.ResetState);
            RestoreStateHandler += new NewTOAPIA.Drawing.RestoreState(aPort.RestoreState);

            //// Setting Attributes and modes
            SetTextColorHandler += new NewTOAPIA.Drawing.SetTextColor(aPort.SetTextColor);

            //// Setting some modes
            SetBkColorHandler += new NewTOAPIA.Drawing.SetBkColor(aPort.SetBkColor);
            SetBkModeHandler += new NewTOAPIA.Drawing.SetBkMode(aPort.SetBkMode);

            SetMappingModeHandler += new NewTOAPIA.Drawing.SetMappingMode(aPort.SetMappingMode);
            SetPolyFillModeHandler += new NewTOAPIA.Drawing.SetPolyFillMode(aPort.SetPolyFillMode);
            SetROP2Handler += new NewTOAPIA.Drawing.SetROP2(aPort.SetROP2);

            SetClipRectangleHandler += new SetClipRectangle(aPort.SetClipRectangle);

            // World transform management
            SetWorldTransformHandler += new NewTOAPIA.Drawing.SetWorldTransform(aPort.SetWorldTransform);
            TranslateTransformHandler += new TranslateTransform(aPort.TranslateTransform);
            ScaleTransformHandler += new ScaleTransform(aPort.ScaleTransform);
            RotateTransformHandler += new RotateTransform(aPort.RotateTransform);
        }

Usage Example

Exemple #1
0
        public SketchWindow(int width, int height)
            :base()
        {
            InitializeComponent();

            fBlackPen = new GDIPen(RGBColor.Black);

            this.Size = new System.Drawing.Size(width, height);
            this.Text = "Sketcher";
            this.AllowDrop = true;

            fPointList = new List<Point>();

            // Create the backing buffer to retain the image
            // Make it bigger than any likely displays
            backingBuffer = GDIDIBSection.Create(1600, 1200);
            GDIContext bufferContext = GDIContext.CreateForBitmap(backingBuffer);

            bufferContext.ClearToWhite();
            fBackingGraphPort = new GDIRenderer(bufferContext);

            fRetainedGraphPort = new GraphPortDelegate();
            fRetainedGraphPort.AddGraphPort(fBackingGraphPort);
            fRetainedGraphPort.AddGraphPort(GraphPort);

            CreateSession();

        }
All Usage Examples Of NewTOAPIA.Drawing.GraphPortDelegate::AddGraphPort