pub struct ImmutableImageBrush { /* private fields */ }Expand description
Paints an area with an image.
Implementations§
Source§impl ImmutableImageBrush
impl ImmutableImageBrush
Sourcepub fn new(
source: Option<Rc<Bitmap>>,
alignment_x: AlignmentX,
alignment_y: AlignmentY,
destination_rect: Option<RelativeRect>,
opacity: f64,
transform: Option<Rc<ImmutableTransform>>,
transform_origin: RelativePoint,
source_rect: Option<RelativeRect>,
stretch: Stretch,
tile_mode: TileMode,
relative_transform: Option<Rc<ImmutableTransform>>,
) -> Self
pub fn new( source: Option<Rc<Bitmap>>, alignment_x: AlignmentX, alignment_y: AlignmentY, destination_rect: Option<RelativeRect>, opacity: f64, transform: Option<Rc<ImmutableTransform>>, transform_origin: RelativePoint, source_rect: Option<RelativeRect>, stretch: Stretch, tile_mode: TileMode, relative_transform: Option<Rc<ImmutableTransform>>, ) -> Self
Creates a brush. destination_rect and source_rect default to the
whole area.
Sourcepub fn from_bitmap(source: Option<Rc<Bitmap>>) -> Self
pub fn from_bitmap(source: Option<Rc<Bitmap>>) -> Self
Creates a brush drawing source with default values for everything
else: centered, uniformly stretched, not tiled and fully opaque.
Sourcepub fn from_brush(source: &dyn IImageBrush) -> Self
pub fn from_brush(source: &dyn IImageBrush) -> Self
Creates an immutable copy of source.
Sourcepub fn source(&self) -> Option<Rc<dyn IImageBrushSource>>
pub fn source(&self) -> Option<Rc<dyn IImageBrushSource>>
The image to draw.
Methods from Deref<Target = ImmutableTileBrush>§
Sourcepub fn alignment_x(&self) -> AlignmentX
pub fn alignment_x(&self) -> AlignmentX
The horizontal alignment of a tile in the destination.
Sourcepub fn alignment_y(&self) -> AlignmentY
pub fn alignment_y(&self) -> AlignmentY
The vertical alignment of a tile in the destination.
Sourcepub fn destination_rect(&self) -> RelativeRect
pub fn destination_rect(&self) -> RelativeRect
The rectangle on the destination in which to paint a tile.
Sourcepub fn transform(&self) -> Option<Rc<dyn ITransform>>
pub fn transform(&self) -> Option<Rc<dyn ITransform>>
The transform of the brush.
Sourcepub fn transform_origin(&self) -> RelativePoint
pub fn transform_origin(&self) -> RelativePoint
The transform origin of the brush.
Sourcepub fn source_rect(&self) -> RelativeRect
pub fn source_rect(&self) -> RelativeRect
The rectangle of the source image that will be displayed.
Sourcepub fn stretch(&self) -> Stretch
pub fn stretch(&self) -> Stretch
A value controlling how the source rectangle will be stretched to fill the destination rect.
Sourcepub fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
pub fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
The transform of the brush, relative to the bounds of the painted area.
Trait Implementations§
Source§impl Clone for ImmutableImageBrush
impl Clone for ImmutableImageBrush
Source§impl Deref for ImmutableImageBrush
impl Deref for ImmutableImageBrush
Source§impl IBrush for ImmutableImageBrush
impl IBrush for ImmutableImageBrush
Source§fn transform_origin(&self) -> RelativePoint
fn transform_origin(&self) -> RelativePoint
The origin of the brush
transform.Source§fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
The transform of the brush, relative to the bounds of the painted
area.
Source§fn as_immutable_brush(&self) -> Option<&dyn IImmutableBrush>
fn as_immutable_brush(&self) -> Option<&dyn IImmutableBrush>
The brush viewed as
IImmutableBrush, when it is one (the is IImmutableBrush test of upstream).Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
The implementing value, for downcasts to immutable brush types. For
mutable brushes use
as_object.Source§fn as_tile_brush(&self) -> Option<&dyn ITileBrush>
fn as_tile_brush(&self) -> Option<&dyn ITileBrush>
The brush viewed as
ITileBrush, when it is one.Source§fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>
fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>
The brush as an
IImmutableBrush handle, when it is immutable.The form of the brush that is sent to the render thread, when the
type keeps one: see
SharedBrush. An
immutable brush creates it once, so its identity is stable.Source§fn as_image_brush(&self) -> Option<&dyn IImageBrush>
fn as_image_brush(&self) -> Option<&dyn IImageBrush>
The brush viewed as
IImageBrush, when it is one.Source§fn as_object(&self) -> Option<&FerroObject>
fn as_object(&self) -> Option<&FerroObject>
The object behind the brush when it is a mutable
Brush.Source§fn as_solid_color_brush(&self) -> Option<&dyn ISolidColorBrush>
fn as_solid_color_brush(&self) -> Option<&dyn ISolidColorBrush>
The brush viewed as
ISolidColorBrush, when it is one.Source§fn as_gradient_brush(&self) -> Option<&dyn IGradientBrush>
fn as_gradient_brush(&self) -> Option<&dyn IGradientBrush>
The brush viewed as
IGradientBrush, when it is one.Source§fn as_linear_gradient_brush(&self) -> Option<&dyn ILinearGradientBrush>
fn as_linear_gradient_brush(&self) -> Option<&dyn ILinearGradientBrush>
The brush viewed as
ILinearGradientBrush, when it is one.Source§fn as_radial_gradient_brush(&self) -> Option<&dyn IRadialGradientBrush>
fn as_radial_gradient_brush(&self) -> Option<&dyn IRadialGradientBrush>
The brush viewed as
IRadialGradientBrush, when it is one.Source§fn as_conic_gradient_brush(&self) -> Option<&dyn IConicGradientBrush>
fn as_conic_gradient_brush(&self) -> Option<&dyn IConicGradientBrush>
The brush viewed as
IConicGradientBrush, when it is one.Source§fn as_scene_brush(&self) -> Option<&dyn ISceneBrush>
fn as_scene_brush(&self) -> Option<&dyn ISceneBrush>
The brush viewed as
ISceneBrush, when it is one.Source§fn as_mutable_brush(&self) -> Option<&dyn IMutableBrush>
fn as_mutable_brush(&self) -> Option<&dyn IMutableBrush>
The brush viewed as
IMutableBrush, when it is one.Source§fn as_composition_render_resource(
&self,
) -> Option<&dyn ICompositionRenderResource>
fn as_composition_render_resource( &self, ) -> Option<&dyn ICompositionRenderResource>
The composition render resource behind the object, if it is a
mutable object with server-side counterparts on the compositors it
is drawn with.
Source§fn as_composition_brush(&self) -> Option<&CompositionBrush>
fn as_composition_brush(&self) -> Option<&CompositionBrush>
The brush as a composition brush, when it is one (the
is CompositionBrush test of upstream).Source§impl IImageBrush for ImmutableImageBrush
impl IImageBrush for ImmutableImageBrush
impl IImmutableBrush for ImmutableImageBrush
Source§impl ITileBrush for ImmutableImageBrush
impl ITileBrush for ImmutableImageBrush
Source§fn alignment_x(&self) -> AlignmentX
fn alignment_x(&self) -> AlignmentX
The horizontal alignment of a tile in the destination.
Source§fn alignment_y(&self) -> AlignmentY
fn alignment_y(&self) -> AlignmentY
The vertical alignment of a tile in the destination.
Source§fn destination_rect(&self) -> RelativeRect
fn destination_rect(&self) -> RelativeRect
The rectangle on the destination in which to paint a tile.
Source§fn source_rect(&self) -> RelativeRect
fn source_rect(&self) -> RelativeRect
The rectangle of the source image that will be displayed.
Auto Trait Implementations§
impl !Freeze for ImmutableImageBrush
impl !RefUnwindSafe for ImmutableImageBrush
impl !Send for ImmutableImageBrush
impl !Sync for ImmutableImageBrush
impl !UnwindSafe for ImmutableImageBrush
impl Unpin for ImmutableImageBrush
impl UnsafeUnpin for ImmutableImageBrush
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more