Aspose.Words.Examples.CSharp.Rendering_and_Printing.RenderShape.FindShapeSizes C# (CSharp) Method

FindShapeSizes() public static method

public static FindShapeSizes ( Shape shape ) : void
shape Shape
return void
        public static void FindShapeSizes(Shape shape)
        {
            // ExStart:FindShapeSizes
            SizeF shapeSizeInDocument = shape.GetShapeRenderer().SizeInPoints;
            float width = shapeSizeInDocument.Width; // The width of the shape.
            float height = shapeSizeInDocument.Height; // The height of the shape.
            
            Size shapeRenderedSize = shape.GetShapeRenderer().GetSizeInPixels(1.0f, 96.0f);

            using (Bitmap image = new Bitmap(shapeRenderedSize.Width, shapeRenderedSize.Height))
            {
                using (Graphics g = Graphics.FromImage(image))
                {
                    // Render shape onto the graphics object using the RenderToScale or RenderToSize methods of ShapeRenderer class.
                }
            }
            // ExEnd:FindShapeSizes
        }
        public static void RenderShapeImage(string dataDir, Shape shape)