Exemplo n.º 1
0
        private void RefreshPreviewImage()
        {
            if (_previewImage != null)
            {
                _previewImage.Dispose();
            }
            NSD.Point dpi;
            using (Graphics g = this.CreateGraphics())
                dpi = new NSD.Point(g.DpiX, g.DpiY);
            using (Doc.Util.C1DXGraphics graphics = new Doc.Util.C1DXGraphics())
            {
                //
                NSD.Size sz = previewPanel.ClientSize;
                graphics.BeginGetImage(sz, dpi);
                graphics.FillRectangle(Color.White, new NSD.Rect(0, 0, sz.Width, sz.Height));
                NSD.Rect previewBounds = new NSD.Rect(c_PreviewOffset, c_PreviewOffset, sz.Width - c_PreviewOffset * 2, sz.Height - c_PreviewOffset * 2);
                _previewObject.Style.Borders = _border;
                _previewFragment.Draw(graphics, previewBounds, null, null);

                using (Doc.C1Image image = graphics.EndGetImage(false))
                {
                    _previewImage = Image.FromStream(image.GetData());
                }
            }
        }
Exemplo n.º 2
0
 public void DrawEllipse(NSD.Point center, double rx, double ry, double width)
 {
     //do nothing, QRCode Custom field does not draw ellipses.
 }
Exemplo n.º 3
0
 public void DrawString(string text, NSD.Point point)
 {
     //do nothing, QRCode Custom field does not draw string.
 }
Exemplo n.º 4
0
 public static Image GetBrushImage(Color backcolor, C1Brush brush, C1.Win.Interop.Size size, C1.Win.Interop.Point dpi)
 {
     using (var dxGraphics = new C1DXGraphics())
     {
         dxGraphics.BeginGetImage(size, dpi);
         var bounds = new C1.Win.Interop.Rect(0, 0, size.Width, size.Height);
         dxGraphics.FillRectangle(backcolor, bounds);
         dxGraphics.FillRectangle(brush, bounds);
         using (C1Image image = dxGraphics.EndGetImage(false))
         {
             return(Image.FromStream(image.GetData()));
         }
     }
 }