Ejemplo n.º 1
0
Archivo: SVG.cs Proyecto: stuart2w/SAW
        public override Fill CreateTextureBrush(SharedImage image, float scale)
        {
            var    netImage = image.GetNetImage();
            string ID       = PrepareImage((Bitmap)netImage, image.GetHashCode(), RectangleF.Empty);

            // This uses a different image key to the actual image insertion; but it is unlikely that the same image would be used both as a texture and an image
            // and it is not the end of the world if the image gets embedded twice
            return(new SVGTexture(ID, netImage.Size, this));
        }
Ejemplo n.º 2
0
 private void ImageChanged()
 {
     m_ImageChanged = true;
     if (m_NewImage != null)
     {
         pnlImagePreview.Image = m_NewImage.GetNetImage();
     }
     ShowRatioAndLayout();
     RefreshPanels();
 }
Ejemplo n.º 3
0
 public override Fill CreateTextureBrush(SharedImage image, float scale)
 {
     try
     {
         TextureBrush create = new TextureBrush(image.GetNetImage());
         Matrix       matrix = create.Transform;           // cannot do Brush.Transform.Scale because Transform returns a copy of the matrix
         matrix.Scale(scale, scale);
         create.Transform = matrix;
         return(new NetFill(create));
     }
     catch (Exception ex)
     {
         // If this fails it returns a hatched brush
         Utilities.LogSubError(ex);
         return(new NetFill(new HatchBrush(HatchStyle.DiagonalCross, Color.Red, Color.White)));
     }
 }