PictureFillFormat Class
Represents a fill with a picture that can either be tiled (as a texture) or stretched to fill the available area. This fill is not supported for outlines, borders and underlines.
public sealed class PictureFillFormat : FillFormat
Public NotInheritable Class PictureFillFormat
Inherits FillFormat
- Inheritance:
- System.ObjectPictureFillFormat
Properties
CropBottom
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the bottom edge of the picture Data specified as a relative value (percentage of the picture data height, value of 1 is equal to 100% of the picture data height).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of bottom top edge of the picture Data.
Remarks
To reverse the effect of extra stretching caused because cropped picture data is stretched, increment the StretchBottom by the CropBottom.
To inset the stretched picture data into the filling area you can either set the StretchBottom to a positive value or CropBottom to a negative value depending on which size you choose to use as a basis (StretchBottom uses filling area height as a basis and CropBottom uses picture data height as a basis).
To outset the stretched picture data outside of the filling area you can either set the StretchBottom to a negative value or CropBottom to a positive value depending on which size you choose to use as a basis (StretchBottom uses filling area height as a basis and CropBottom uses picture data height as a basis).
If the picture is tiled (TileAsTexture is true), then cropped parts of the picture data are covered by the adjacent tiles and all tiles consist of the non-cropped part of the picture data.
CropLeft
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the left edge of the picture Data specified as a relative value (percentage of the picture data width, value of 1 is equal to 100% of the picture data width).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of the left edge of the picture Data.
Remarks
To reverse the effect of extra stretching caused because cropped picture data is stretched, increment the StretchLeft by the CropLeft.
To inset the stretched picture data into the filling area you can either set the StretchLeft to a positive value or CropLeft to a negative value depending on which size you choose to use as a basis (StretchLeft uses filling area width as a basis and CropLeft uses picture data width as a basis).
To outset the stretched picture data outside of the filling area you can either set the StretchLeft to a negative value or CropLeft to a positive value depending on which size you choose to use as a basis (StretchLeft uses filling area width as a basis and CropLeft uses picture data width as a basis).
If the picture is tiled (TileAsTexture is true), then cropped parts of the picture data are covered by the adjacent tiles and all tiles consist of the non-cropped part of the picture data.
CropRight
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the right edge of the picture Data specified as a relative value (percentage of the picture data width, value of 1 is equal to 100% of the picture data width).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of the right edge of the picture Data.
Remarks
To reverse the effect of extra stretching caused because cropped picture data is stretched, increment the StretchRight by the CropRight.
To inset the stretched picture data into the filling area you can either set the StretchRight to a positive value or CropRight to a negative value depending on which size you choose to use as a basis (StretchRight uses filling area width as a basis and CropRight uses picture data width as a basis).
To outset the stretched picture data outside of the filling area you can either set the StretchRight to a negative value or CropRight to a positive value depending on which size you choose to use as a basis (StretchRight uses filling area width as a basis and CropRight uses picture data width as a basis).
If the picture is tiled (TileAsTexture is true), then cropped parts of the picture data are covered by the adjacent tiles and all tiles consist of the non-cropped part of the picture data.
CropTop
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the top edge of the picture Data specified as a relative value (percentage of the picture data height, value of 1 is equal to 100% of the picture data height).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of the top edge of the picture Data.
Remarks
To reverse the effect of extra stretching caused because cropped picture data is stretched, increment the StretchTop by the CropTop.
To inset the stretched picture data into the filling area you can either set the StretchTop to a positive value or CropTop to a negative value depending on which size you choose to use as a basis (StretchTop uses filling area height as a basis and CropTop uses picture data height as a basis).
To outset the stretched picture data outside of the filling area you can either set the StretchTop to a negative value or CropTop to a positive value depending on which size you choose to use as a basis (StretchTop uses filling area height as a basis and CropTop uses picture data height as a basis).
If the picture is tiled (TileAsTexture is true), then cropped parts of the picture data are covered by the adjacent tiles and all tiles consist of the non-cropped part of the picture data.
Data
Gets the picture data that has an associated content that is either embedded in or linked to the presentation file.
Property Value
The picture data that has an associated content that is either embedded in or linked to the presentation file.
FillType
Gets the Picture value.
public override FillFormatType FillType { get; }
Public Overrides ReadOnly Property FillType As FillFormatType
Property Value
The Picture value.
Overrides
RotateWithShape
Gets or sets a value indicating whether the fill should rotate with the shape.
Default value: true.
Property Value
- System.Boolean
true if fill should rotate with the shape; otherwise, false.
Remarks
If set to true and a shape that has been filled with a picture is transformed with a rotation, then the fill will be transformed with the same rotation.
StretchBottom
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the bottom edge of the stretched picture fill from the bottom edge of the filling area specified as a relative value (percentage of the filling area height, value of 1 is equal to 100% of the filling area height).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of the bottom edge of the stretched picture fill from the bottom edge of the filling area.
StretchLeft
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the left edge of the stretched picture fill from the left edge of the filling area specified as a relative value (percentage of the filling area width, value of 1 is equal to 100% of the filling area width).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of the left edge of the stretched picture fill from the left edge of the filling area.
StretchRight
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the right edge of the stretched picture fill from the right edge of the filling area specified as a relative value (percentage of the filling area width, value of 1 is equal to 100% of the filling area width).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of the right edge of the stretched picture fill from the right edge of the filling area.
StretchTop
Gets or sets the offset (inset if the value is positive or outset if the value is negative) of the top edge of the stretched picture fill from the top edge of the filling area specified as a relative value (percentage of the filling area height, value of 1 is equal to 100% of the filling area height).
Property Value
- System.Double
The offset (inset if the value is positive or outset if the value is negative) of the top edge of the stretched picture fill from the top edge of the filling area.
TileAsTexture
Gets or sets a value indicating whether the fill should tile as a texture or stretch over the filling area.
Property Value
- System.Boolean
true if fill should tile as a texture; otherwise, false to stretch it over the filling area.
TilingAlignment
Gets or sets a value indicating where to align the first tile with respect to the filling area.
Alignment happens after the scaling, but before the additional offset.
public RectangleAlignment TilingAlignment { get; set; }
Public Property TilingAlignment As RectangleAlignment
Property Value
A value indicating where to align the first tile with respect to the filling area.
TilingMirrorType
Specifies the direction(s) in which to flip the source image while tiling.
Images may be flipped horizontally, vertically, or in both directions to fill the entire region.
public TileMirrorTypes TilingMirrorType { get; set; }
Public Property TilingMirrorType As TileMirrorTypes
Property Value
The direction(s) in which to flip the source image while tiling.
TilingOffsetX
Gets or sets the additional horizontal offset after tiling alignment.
Property Value
The additional horizontal offset after tiling alignment.
TilingOffsetY
Gets or sets the additional vertical offset after tiling alignment.
Property Value
The additional vertical offset after tiling alignment.
TilingScaleX
Gets or sets the horizontal tiling scale in range from 0 = 0% to 1 = 100%.
Property Value
- System.Double
The horizontal tiling scale.
TilingScaleY
Gets or sets the vertical tiling scale in range from 0 = 0% to 1 = 100%.
Property Value
- System.Double
The vertical tiling scale.
Methods
SetData(Content)
Sets the picture data.
public PictureContent SetData(Content content)
Public Function SetData(content As Content) As PictureContent
Parameters
content
- Content
The picture content that should be set.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload if multiple PictureFillFormats should share the same picture data.
Exceptions
- System.ArgumentNullException
content
is null.
SetData(Content, PictureCompressionType)
Sets the picture data.
public PictureContent SetData(Content content, PictureCompressionType compressionType)
Public Function SetData(content As Content, compressionType As PictureCompressionType) As PictureContent
Parameters
content
- Content
The picture content that should be set.
compressionType
- PictureCompressionType
Compression level that the generating application can use as a guidance when optimizing picture data size.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload if multiple PictureFillFormats should share the same picture data but with different compression levels.
Exceptions
- System.ArgumentNullException
content
is null.
SetData(Stream)
Sets the picture data.
public PictureContent SetData(Stream stream)
Public Function SetData(stream As Stream) As PictureContent
Parameters
stream
- System.IO.Stream
Stream containing the picture data.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload to automatically detect the picture content type from the decoded picture stream
.
Exceptions
- System.ArgumentNullException
stream
is null.
- System.ArgumentException
Picture stream
encoding format is not supported.
SetData(Stream, PictureContentType)
Sets the picture data.
public PictureContent SetData(Stream stream, PictureContentType contentType)
Public Function SetData(stream As Stream, contentType As PictureContentType) As PictureContent
Parameters
stream
- System.IO.Stream
The picture data stream.
contentType
- PictureContentType
Content type of the picture data.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload to explicitly specify picture content type so that the picture stream
doesn't have to be decoded to detect the picture content type.
Exceptions
- System.ArgumentNullException
stream
is null.
SetData(Stream, String)
Sets the picture data.
public PictureContent SetData(Stream stream, string contentType)
Public Function SetData(stream As Stream, contentType As String) As PictureContent
Parameters
stream
- System.IO.Stream
The picture data stream.
contentType
- System.String
Content type (MIME type) of the picture data.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload to explicitly specify picture content type that is not supported by the PictureContentType.
Exceptions
- System.ArgumentNullException
stream
is null.
- System.ArgumentException
contentType
is null or System.String.Empty.
SetData(String, PictureContentType)
Sets the picture data.
public PictureContent SetData(string picturePath, PictureContentType contentType)
Public Function SetData(picturePath As String, contentType As PictureContentType) As PictureContent
Parameters
picturePath
- System.String
Path to a picture data.
contentType
- PictureContentType
Content type of the picture data.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload to explicitly specify picture content type (for example, if picturePath
doesn't specify a file extension).
Exceptions
- System.ArgumentException
picturePath
is null or System.String.Empty.
SetData(String, Boolean)
Sets the picture data.
public PictureContent SetData(string picturePath, bool isLink = false)
Public Function SetData(picturePath As String, isLink As Boolean = False) As PictureContent
Parameters
picturePath
- System.String
Path or link to a picture data.
isLink
- System.Boolean
true if the picture is linked to the file in which PresentationDocument instance is saved; otherwise, false.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload to automatically detect the picture content type from the picturePath
extension.
Parameter picturePath
must contain supported extension (for example, ".png") if isLink
is false, otherwise exception is thrown.
Exceptions
- System.ArgumentException
picturePath
is null or System.String.Empty or picturePath
doesn't contain extension or extension is not supported.
SetData(String, String)
Sets the picture data.
public PictureContent SetData(string picturePath, string contentType)
Public Function SetData(picturePath As String, contentType As String) As PictureContent
Parameters
picturePath
- System.String
Path to a picture data.
contentType
- System.String
Content type (MIME type) of the picture data.
Returns
An instance of a PictureContent class that represents the picture data that has been set.
Remarks
Use this overload to explicitly specify picture content type that is not supported by the PictureContentType.
Exceptions
- System.ArgumentException
picturePath
or contentType
is null or System.String.Empty.
Inherited Methods
SetGradient(GradientFillType) | Sets the fill to the gradient fill. (Inherited from FillFormat) |
SetNone() | Sets the fill to none, thus making the area transparent. (Inherited from FillFormat) |
SetPattern(PatternFillType, Color, Color) | Sets the fill to the pattern fill. (Inherited from FillFormat) |
SetPicture(Content) | Sets the fill to the picture fill. This method is not applicable on Fill property. (Inherited from FillFormat) |
SetPicture(System.IO.Stream) | Sets the fill to the picture fill. This method is not applicable on Fill property. (Inherited from FillFormat) |
SetPicture(System.IO.Stream, PictureContentType) | Sets the fill to the picture fill. This method is not applicable on Fill property. (Inherited from FillFormat) |
SetPicture(System.IO.Stream, System.String) | Sets the fill to the picture fill. This method is not applicable on Fill property. (Inherited from FillFormat) |
SetPicture(System.String, System.Boolean) | Sets the fill to the picture fill. This method is not applicable on Fill property. (Inherited from FillFormat) |
SetPicture(System.String, PictureContentType) | Sets the fill to the picture fill. This method is not applicable on Fill property. (Inherited from FillFormat) |
SetPicture(System.String, System.String) | Sets the fill to the picture fill. This method is not applicable on Fill property. (Inherited from FillFormat) |
SetSlideBackground() | Sets the fill of the Shape to that of the slide background surface. Applicable only on Shape's fill. This method does not set the fill of the shape to be transparent but instead sets it to be filled with the portion of the slide background that is directly behind it. (Inherited from FillFormat) |
SetSolid(Color) | Sets the fill to the solid fill. (Inherited from FillFormat) |