Struct
OfficeImagePlacement
OfficeIMO.Drawing
Describes the destination rectangle used when placing an image into a target box.
Inheritance
- ValueType
- OfficeImagePlacement
Usage
Explore 11 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 6
- Property OfficeDrawingTilingPattern.Area
- Method OfficeImagePatternLayout.GetTilePlacements
- Property OfficeImagePatternLayout.Area
- Property OfficeImagePatternLayout.Tile
- Method OfficeImagePlacement.Fit
- Property OfficeImageProjection.Placement
Accepted by parameters 5
- Method OfficeDrawing.AddTilingPattern
- Constructor OfficeDrawingTilingPattern.OfficeDrawingTilingPattern
- Constructor OfficeImagePatternLayout.OfficeImagePatternLayout
- Constructor OfficeImagePatternLayout.OfficeImagePatternLayout
- Constructor OfficeImageProjection.OfficeImageProjection
Constructors
public OfficeImagePlacement(double x, double y, double width, double height) #Creates a new image placement rectangle.
Parameters
- x double
- y double
- width double
- height double
Methods
public static bool ExceedsAspectRatioDistortion(double sourceWidth, double sourceHeight, double targetWidth, double targetHeight, double thresholdRatio) #Returns whether a source image would visibly distort when stretched into a target rectangle.
Parameters
- sourceWidth double
- Source image width.
- sourceHeight double
- Source image height.
- targetWidth double
- Target rectangle width.
- targetHeight double
- Target rectangle height.
- thresholdRatio double
- Minimum distortion ratio considered visible. Values below 1 are invalid.
Returns
boolpublic static OfficeImagePlacement Fit(double sourceWidth, double sourceHeight, double targetX, double targetY, double targetWidth, double targetHeight, OfficeImageFit fit = Stretch) #Fits a source image into a target rectangle using the requested image fit mode.
Parameters
- sourceWidth double
- Source image width.
- sourceHeight double
- Source image height.
- targetX double
- Target rectangle left coordinate.
- targetY double
- Target rectangle top coordinate.
- targetWidth double
- Target rectangle width.
- targetHeight double
- Target rectangle height.
- fit OfficeIMO.Drawing.OfficeImageFit = Stretch
- Image fit mode.
public static double GetAspectRatioDistortionRatio(double sourceWidth, double sourceHeight, double targetWidth, double targetHeight) #Calculates the visible aspect-ratio change between a source image and a target rectangle.
Parameters
- sourceWidth double
- Source image width.
- sourceHeight double
- Source image height.
- targetWidth double
- Target rectangle width.
- targetHeight double
- Target rectangle height.
Returns
double A ratio greater than or equal to 1 where 1 means the source and target aspect ratios match.public ValueTuple<double, double, double, double> ToTuple() #Converts the placement into a tuple.
Returns
ValueTuple<double, double, double, double>