BitmapTransform BitmapTransform BitmapTransform BitmapTransform Class

Contains transformations that can be applied to pixel data.

Syntax

Declaration

public sealed class BitmapTransformpublic sealed class BitmapTransformPublic NotInheritable Class BitmapTransform

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 summary

Creates a new @Windows.Graphics.Imaging.BitmapTransform.#ctor object.

Properties summary

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.

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

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

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

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.

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.

Constructors

  • BitmapTransform()
    BitmapTransform()
    BitmapTransform()
    BitmapTransform()

    Creates a new @Windows.Graphics.Imaging.BitmapTransform.#ctor object.

    public BitmapTransform()public BitmapTransform()Public Function BitmapTransform() As

    Remarks

    The default values of @Windows.Graphics.Imaging.BitmapTransform.#ctor result in a pass-through operation.

Properties

  • Bounds
    Bounds
    Bounds
    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.

    public BitmapBounds Bounds { get; set; }public BitmapBounds Bounds { get; set; }Public ReadWrite Property Bounds As BitmapBounds

    Property Value

  • Flip
    Flip
    Flip
    Flip

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

    public BitmapFlip Flip { get; set; }public BitmapFlip Flip { get; set; }Public ReadWrite Property Flip As BitmapFlip

    Property Value

  • InterpolationMode
    InterpolationMode
    InterpolationMode
    InterpolationMode

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

    public BitmapInterpolationMode InterpolationMode { get; set; }public BitmapInterpolationMode InterpolationMode { get; set; }Public ReadWrite Property InterpolationMode As BitmapInterpolationMode

    Property Value

  • Rotation
    Rotation
    Rotation
    Rotation

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

    public BitmapRotation Rotation { get; set; }public BitmapRotation Rotation { get; set; }Public ReadWrite Property Rotation As BitmapRotation

    Property Value

  • ScaledHeight
    ScaledHeight
    ScaledHeight
    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.

    public uint ScaledHeight { get; set; }public uint ScaledHeight { get; set; }Public ReadWrite Property ScaledHeight As uint

    Property Value

    • uint
      uint
      uint
      uint

      The height of the bitmap, in pixels.

  • ScaledWidth
    ScaledWidth
    ScaledWidth
    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.

    public uint ScaledWidth { get; set; }public uint ScaledWidth { get; set; }Public ReadWrite Property ScaledWidth As uint

    Property Value

    • uint
      uint
      uint
      uint

      The width of the bitmap, in pixels.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Graphics.Imaging.dll