Click or drag to resize
Transform3DEffect Class
[NoComposition] Applies an arbitrary 4x4 transform matrix to an image.
Inheritance Hierarchy

Namespace:  Microsoft.Graphics.Canvas.Effects
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public sealed class Transform3DEffect : ICanvasEffect, 
	IGraphicsEffect, IGraphicsEffectSource, ICanvasImage, IDisposable

The Transform3DEffect type exposes the following members.

Public methodTransform3DEffect
Initializes a new instance of the Transform3DEffect class.
Public propertyBorderMode
Gets and sets border mode for edge pixels.
Public propertyBufferPrecision
Specifies what precision to use for intermediate buffers when drawing this effect.
Public propertyCacheOutput
Enables caching the output from drawing this effect.
Public propertyInterpolationMode
Gets or sets the interpolation mode for Transform3DEffect effect.
Public propertyName
Attaches a user-defined name string to the effect.
Public propertySource
Gets or sets the input source for Transform3DEffect effect.
Public propertyTransformMatrix
Gets or sets 4x4 transform matrix applied to the projection plane.
Public methodDispose
Releases all resources used by the effect.
Public methodGetBounds(ICanvasResourceCreator)
Retrieves the bounds of this Transform3DEffect.
Public methodGetBounds(ICanvasResourceCreator, Matrix3x2)
Retrieves the bounds of this Transform3DEffect.
Public methodGetInvalidRectangles
Queries what regions of the effect output have changed since it was last drawn.
Public methodCode exampleGetRequiredSourceRectangle
Queries what part of an effect source image is needed to draw an output region.
Public methodGetRequiredSourceRectangles
Queries what parts of the effect source images are needed to draw an output region.
Public methodInvalidateSourceRectangle
Notifies the effect that one of its source images has changed.

Supported by Win2D but not Windows.UI.Composition.


Suppose, we have a cat image loaded as CanvasBitmap.

Transform3DEffect transformEffect = new Transform3DEffect()
    Source = cat,
    TransformMatrix = Matrix4x4.CreateRotationZ(0.5f, new Vector3(0, 0, 0))

Use the Draw event to display it:

void myWidget_Draw(CanvasControl sender, CanvasDrawEventArgs args)
    args.DrawingSession.DrawImage(transformEffect, 42, 42);

This Windows Runtime type corresponds to the D2D 3D transform effect.

See Also