ToImage

ToImage(Stream, ImageFormat)

Creates the shape image and saves it to a stream in the specified format.

[Obsolete("Use Shape.ToImage(Stream, ImageType) method instead.")]
public void ToImage(Stream stream, ImageFormat imageFormat)
Parameter Type Description
stream Stream The output stream.
imageFormat ImageFormat The format in which to save the image.

Remarks

NOTE: This member is now obsolete. Instead, please use Shape.ToImage(Stream, ImageType) method. This property will be removed 12 months later since July 2022. Aspose apologizes for any inconvenience you may have experienced.

See Also


ToImage(Stream, ImageType)

Creates the shape image and saves it to a stream in the specified format.

public void ToImage(Stream stream, ImageType imageType)
Parameter Type Description
stream Stream The output stream.
imageType ImageType The type in which to save the image.

Remarks

The following formats are supported: .bmp, .gif, .jpg, .jpeg, .tiff, .emf.

Examples


[C#]
MemoryStream imageStream = new MemoryStream();
shape.ToImage(imageStream, ImageType.Png);

See Also


ToImage(string, ImageOrPrintOptions)

Saves the shape to a file.

public void ToImage(string imageFile, ImageOrPrintOptions options)

Examples


[C#]
ImageOrPrintOptions op = new ImageOrPrintOptions();
shape.ToImage("exmaple.png", op);

See Also


ToImage(Stream, ImageOrPrintOptions)

Saves the shape to a stream.

public void ToImage(Stream stream, ImageOrPrintOptions options)

Examples


[C#]
MemoryStream imageStream = new MemoryStream();
ImageOrPrintOptions op = new ImageOrPrintOptions();
shape.ToImage(imageStream, op);

See Also


ToImage(ImageOrPrintOptions)

Returns the bitmap object of the shape .

public Bitmap ToImage(ImageOrPrintOptions options)

Examples


[C#]
ImageOrPrintOptions op = new ImageOrPrintOptions();
System.Drawing.Bitmap btm = shape.ToImage(op);

See Also