Class CroppedBitmap
Crops a Bitmap.
public class CroppedBitmap : AvaloniaObject, INotifyPropertyChanged, IImage, IDisposable
- Inheritance
-
CroppedBitmap
- Implements
- Inherited Members
- Extension Methods
Constructors
CroppedBitmap()
public CroppedBitmap()
CroppedBitmap(IImage, PixelRect)
public CroppedBitmap(IImage source, PixelRect sourceRect)
Parameters
Fields
SourceProperty
Defines the Source property.
public static readonly StyledProperty<IImage?> SourceProperty
Field Value
SourceRectProperty
Defines the SourceRect property.
public static readonly StyledProperty<PixelRect> SourceRectProperty
Field Value
Properties
Size
Gets the size of the image, in device independent pixels.
public Size Size { get; }
Property Value
Source
Gets or sets the source for the bitmap.
public IImage? Source { get; set; }
Property Value
SourceRect
Gets or sets the rectangular area that the bitmap is cropped to.
public PixelRect SourceRect { get; set; }
Property Value
Methods
Dispose()
public virtual void Dispose()
Draw(DrawingContext, Rect, Rect)
Draws the image to a DrawingContext.
public void Draw(DrawingContext context, Rect sourceRect, Rect destRect)
Parameters
context
DrawingContextThe drawing context.
sourceRect
RectThe rect in the image to draw.
destRect
RectThe rect in the output to draw to.
Events
Invalidated
Raised when the resource changes visually.
public event EventHandler? Invalidated