Delen via


BitmapTransform Class

Definition

Contains transformations that can be applied to pixel data.

public ref class BitmapTransform sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class BitmapTransform final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class BitmapTransform final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class BitmapTransform
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class BitmapTransform
function BitmapTransform()
Public NotInheritable Class BitmapTransform
Inheritance
Object Platform::Object IInspectable BitmapTransform
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The default values of BitmapTransform result in a pass-through operation.

The order of operations is when setting multiple transform operations is:

  1. Scale
  2. Flip
  3. Rotation
  4. Crop You should be careful to use the correct coordinate space when specifying each transform’s parameters. Scaling occurs before rotations and flips, and therefore you should specify ScaledWidth and ScaledHeight in the source image’s coordinate space. Cropping occurs after all other transforms, and therefore you should specify Bounds in the final scaled/flipped/rotated coordinate space.

If you are using BitmapTransform with a method that performs EXIF orientation, such as GetPixelDataAsync, note that the EXIF orientation operation is combined with the flip/rotate stage. In these cases the behavior of ScaledWidth and ScaledHeight are not affected as scaling occurs before flip/rotate. However, when specifying Bounds you need to account for coordinate space changes from Flip and Rotation, as well as the EXIF orientation operation. You can obtain the full image size after EXIF orientation is applied by using OrientedPixelWidth and OrientedPixelHeight.

Constructors

BitmapTransform()

Creates a new BitmapTransform object.

Properties

Bounds

Specifies the bounding rectangle that is used to crop the bitmap. This rectangle is defined in the coordinate space after scale, rotation, and flip are applied.

Flip

Specifies the flip operation that is used to transform the bitmap.

InterpolationMode

Specifies the interpolation mode that is used to scale the bitmap.

Rotation

Specifies the rotation operation that is used to transform the bitmap.

ScaledHeight

Specifies the height, in pixels, of the bitmap after it is scaled. This is defined in the coordinate space of the source image, before rotation and flip are applied.

ScaledWidth

Specifies the width, in pixels, of the bitmap after it is scaled. This is defined in the coordinate space of the source image, before rotation and flip are applied.

Applies to