Namespace TallComponents.PDF.Shapes
Class ImageShape
A shape containing bitmap image.
In XML you can specifiy the image data as Base64 encoded data.
You can convert an image file to Base64 using the .NET method . C# string base64Data; using ( FileStream fs = new FileStream( fileName , FileMode.Open ) ) { byte[] bytes = new byte[ fs.Length ]; fs.Read( bytes, 0, bytes.Length ); base64Data = Convert.ToBase64String( bytes ); }
Syntax
public class ImageShape : ContentShape
Constructors
ImageShape()
Creates a new ImageShape.
ImageShape(Bitmap)
Create a new ImageShape from a System.Drawing.Bitmap.
This constructor allows you to draw to a GDI+ surface and pass it to the ImageShape
class without intermediate, temporary file.
ImageShape(Bitmap,Boolean)
Create a new ImageShape from a System.Drawing.Bitmap.
This constructor allows you to draw to a GDI+ surface and pass it to the ImageShape
class without intermediate, temporary file.
ImageShape(Bitmap,Int32)
Create a new ImageShape from a System.Drawing.Bitmap and select a frame index.
This constructor allows you to draw to a GDI+ surface and pass it to the ImageShape
class without intermediate, temporary file.
ImageShape(Bitmap,Int32,Boolean)
Create a new ImageShape from a System.Drawing.Bitmap and select a frame index.
This constructor allows you to draw to a GDI+ surface and pass it to the ImageShape
class without intermediate, temporary file.
ImageShape(Stream)
Create a new ImageShape from a stream of binary data.
ImageShape(Stream,Int32,Boolean)
Create a new ImageShape from a stream of binary data.
ImageShape(String)
Create a new image shape from a relative or virtual path.
ImageShape(String,Int32)
Create a new image shape from a relative, absolute or virtual path.
Properties
Compression Compression
The compression to apply to the image data.
Int32 FrameCount
The number of frames in the image.
Int32 FrameIndex
The FrameIndex which will be used to get the actual image data from the Bitmap
Double Height
The height of the image.
Double HorizontalResolution
Get the horizontal resolution, in pixels per inch, of this image.
Int64 HorizontalSize
Get the horizontal size (width) in pixels of this image.
Boolean IgnoreAlpha
Set to true to completely ignore alpha transparency in the image. If no alpha information
is available this setting is ignored.
Default value is false.
Boolean InvertCmykChannels
Set to true to invert the colors in a CMYK image.
Boolean KeepAspectRatio
If KeepAspectRatio is set to true, the height is calculated from the
width so that the width/height ratio is equal to the columns/rows ratio
of the raster of the original image. If set to false, the specified
width and height are used and the image will in general appear distorted.
Color MaskColor
Set the color that will act as the transparent color.
String Path
Relative or absolute path of image file.
Double VerticalResolution
Get the vertical resolution, in pixels per inch, of this image.
Int64 VerticalSize
Get the vertical size (height) in pixels of this image.
Double Width
The width of the image.
Methods
Shape Clone()
Clones a Shape.
Bitmap CreateBitmap()
This function created a bitmap based on an extracted ImageShape (returned by page.CreateShapes).
Int32 GetFrameCount(Bitmap)
Extract the number of frames from the image data.
Int32 GetFrameCount(Stream)
Extract the number of frames from the image data.
Int32 GetFrameCount(String)
Extract the number of frames from the image data.
Int32 GetFrameCount(String,Object,GetWebCredentialsEventHandler)
Extract the number of frames from the image data.