Ejemplo n.º 1
0
        private void OnCanvasPrePaint(NCanvasPaintEventArgs args)
        {
            NCanvas canvas = args.TargetNode as NCanvas;

            if (canvas == null)
            {
                return;
            }

            NPaintVisitor pv = args.PaintVisitor;

            pv.ClearStyles();

            if (m_PaintImageInRectangle)
            {
                pv.PaintImage(NResources.Image_JpegSuite_q080_jpg.ImageSource, new NRectangle(m_PosX, m_PosY, m_Width, m_Height));
            }
            else
            {
                pv.PaintImage(NResources.Image_JpegSuite_q080_jpg.ImageSource, new NPoint(m_PosX, m_PosY));
            }

            // paint a border around the canvas
            pv.SetStroke(NColor.Black, 1);
            pv.PaintRectangle(0, 0, canvas.Width, canvas.Height);
        }