Exemple #1
0
        public override void Paint(Graphics g, object obj)
        {
            GraphicsState gs = g.Save();

            g.TranslateTransform(X, Y);
            if (_rotation != 0)
            {
                g.RotateTransform(-_rotation);
            }

            Image img = _imageProxy == null ? null : _imageProxy.GetImage();

            if (null != img)
            {
                if (this.AutoSize)
                {
                    this.Width  = (img.Width / img.HorizontalResolution) * g.DpiX;
                    this.Height = (img.Height / img.VerticalResolution) * g.DpiY;
                }

                g.DrawImage(img, 0, 0, Width, Height);
            }

            g.Restore(gs);
        }
 private PointD2D GetSizeOfImageProxy(ImageProxy proxy)
 {
     if (proxy is ISyntheticRepeatableTexture)
     {
         return(((ISyntheticRepeatableTexture)proxy).Size);
     }
     else
     {
         var img = proxy.GetImage();
         return(new PointD2D(img.Width * 72.0 / img.HorizontalResolution, img.Height * 72.0 / img.VerticalResolution));
     }
 }
 public override Image GetImage()
 {
     return(_imageProxy == null ? null : _imageProxy.GetImage());
 }