Example #1
0
        public SineWave(Size aSize, int nSegments)
        {
            fNumSegments = nSegments;
            fSize = aSize;
            redPen = new GPen(RGBColor.Red);
            linePen = new GPen(RGBColor.Cyan);

        }
        //public override void GradientTriangle(TRIVERTEX[] pVertex, GRADIENT_TRIANGLE[] pMesh, uint dwMode)
        //{
        //    EMRGRADIENTFILL gradFill = new EMRGRADIENTFILL();
        //    gradFill.rclBounds = RECT.Empty;
        //    gradFill.nVer = (uint)pVertex.Length;
        //    gradFill.nTri = (uint)pMesh.Length;
        //    gradFill.ulMode = dwMode;
        //    gradFill.Ver = pVertex;

        //    PackCommand(gradFill);
        //}

        /// DrawEllipse
        ///
        public override void DrawEllipse(GPen aPen, Rectangle rect)
        {
            BufferChunk chunk = new BufferChunk(128);

            chunk += GDI32.EMR_ELLIPSE;
            Pack(chunk, rect);

            PackCommand(chunk);
        }
        public override void DrawRectangle(GPen aPen, Rectangle rect)
        {
            BufferChunk chunk = new BufferChunk(128);

            chunk += GDI32.EMR_RECTANGLE;
            Pack(chunk, rect);

            PackCommand(chunk);
        }
        public override void DrawLines(GPen aPen, Point[] points)
        {
            BufferChunk chunk = new BufferChunk(points.Length * 8 + 16);

            chunk += GDI32.EMR_POLYLINE;

            Pack(chunk, points);

            PackCommand(chunk);
        }
        public override void DrawRoundRect(GPen aPen, Rectangle rect)
        {
            BufferChunk chunk = new BufferChunk(128);

            chunk += GDI32.EMR_ROUNDRECT;
            Pack(chunk, rect);
            Pack(chunk, width, height);

            PackCommand(chunk);
        }
Example #6
0
        public void RunOnce(IDraw2D aPort)
        {
            //aPort.SaveState();
            GPen rectPen = new GPen(RGBColor.Red);
            GDIBrush rectBrush = new GDISolidBrush(RGBColor.Pink);

            for (int coord = 10; coord < fSize.Height; coord += 50)
            {
                aPort.FillRectangle(rectBrush, new Rectangle(coord, coord, 200, 200));
                aPort.DrawRectangle(rectPen, new Rectangle(coord, coord, 200, 200));
            }

            //aPort.ResetState();
        }
        //public override void UseDefaultBrush()
        //{
        //    BufferChunk chunk = new BufferChunk(128);
        //    chunk += GDI32.EMR_SELECTSTOCKOBJECT;
        //    chunk += GDI32.DC_BRUSH;

        //    PackCommand(chunk);
        //}

        //public override void SetDefaultPenColor(uint colorref)
        //{
        //    BufferChunk chunk = new BufferChunk(128);
        //    chunk += GDI32.EMR_SETDCPENCOLOR;
        //    chunk += colorref;

        //    PackCommand(chunk);
        //}

        public override void SetPen(GPen aPen)
        {
            SelectUniqueObject(aPen.UniqueID);
        }