pub struct WriteableBitmapRef(pub Rc<WriteableBitmap>);Expand description
A writeable bitmap held by a property.
Tuple Fields§
§0: Rc<WriteableBitmap>Implementations§
Methods from Deref<Target = WriteableBitmap>§
Sourcepub fn format(&self) -> Option<PixelFormat>
pub fn format(&self) -> Option<PixelFormat>
The pixel format of the bitmap.
Sourcepub fn lock(&self) -> Rc<dyn ILockedFramebuffer>
pub fn lock(&self) -> Rc<dyn ILockedFramebuffer>
Locks the pixel data of the bitmap and returns a framebuffer that can be used to read and write the pixels. The changes are committed when the framebuffer is disposed.
Sourcepub fn copy_pixels(
&self,
source_rect: PixelRect,
buffer: &mut [u8],
stride: i32,
)
pub fn copy_pixels( &self, source_rect: PixelRect, buffer: &mut [u8], stride: i32, )
Copies the pixels of source_rect into buffer, whose rows are
stride bytes apart. An empty source_rect selects the whole
bitmap.
Methods from Deref<Target = Bitmap>§
Sourcepub fn create_scaled_bitmap(
&self,
destination_size: PixelSize,
interpolation_mode: BitmapInterpolationMode,
) -> Bitmap
pub fn create_scaled_bitmap( &self, destination_size: PixelSize, interpolation_mode: BitmapInterpolationMode, ) -> Bitmap
Creates a bitmap scaled to the specified size from the current bitmap.
Sourcepub fn pixel_size(&self) -> PixelSize
pub fn pixel_size(&self) -> PixelSize
The size of the bitmap, in device pixels.
Sourcepub fn platform_impl(&self) -> &RefCounted<dyn IBitmapImpl + Sync + Send>
pub fn platform_impl(&self) -> &RefCounted<dyn IBitmapImpl + Sync + Send>
The platform-specific bitmap implementation.
Sourcepub fn save_to_file(
&self,
file_name: &str,
options: &BitmapEncoderOptions,
) -> Result<(), Error>
pub fn save_to_file( &self, file_name: &str, options: &BitmapEncoderOptions, ) -> Result<(), Error>
Saves the bitmap to a file.
Sourcepub fn save(
&self,
stream: &mut dyn Write,
options: &BitmapEncoderOptions,
) -> Result<(), Error>
pub fn save( &self, stream: &mut dyn Write, options: &BitmapEncoderOptions, ) -> Result<(), Error>
Saves the bitmap to a stream.
Sourcepub fn format(&self) -> Option<PixelFormat>
pub fn format(&self) -> Option<PixelFormat>
The pixel format of the bitmap, if its pixels can be read.
Sourcepub fn alpha_format(&self) -> Option<AlphaFormat>
pub fn alpha_format(&self) -> Option<AlphaFormat>
The alpha format of the bitmap, if its pixels can be read.
Sourcepub fn copy_pixels(
&self,
source_rect: PixelRect,
buffer: &mut [u8],
stride: i32,
)
pub fn copy_pixels( &self, source_rect: PixelRect, buffer: &mut [u8], stride: i32, )
Copies the pixels of source_rect into buffer, whose rows are
stride bytes apart. An empty source_rect selects the whole
bitmap.
Panics when the pixels of the bitmap cannot be read, when the bitmap was converted from another pixel format on creation, or when the rectangle, stride or buffer are out of range.
Sourcepub fn copy_pixels_to_framebuffer(&self, buffer: &dyn ILockedFramebuffer)
pub fn copy_pixels_to_framebuffer(&self, buffer: &dyn ILockedFramebuffer)
Copies the pixels of the bitmap into a locked framebuffer, converting them to its pixel and alpha formats.
Panics when the pixels of the bitmap cannot be read.
Trait Implementations§
Source§impl Clone for WriteableBitmapRef
impl Clone for WriteableBitmapRef
Source§impl Debug for WriteableBitmapRef
impl Debug for WriteableBitmapRef
Source§impl Deref for WriteableBitmapRef
impl Deref for WriteableBitmapRef
Source§type Target = WriteableBitmap
type Target = WriteableBitmap
Source§fn deref(&self) -> &WriteableBitmap
fn deref(&self) -> &WriteableBitmap
Source§impl From<Rc<WriteableBitmap>> for WriteableBitmapRef
impl From<Rc<WriteableBitmap>> for WriteableBitmapRef
Source§fn from(value: Rc<WriteableBitmap>) -> Self
fn from(value: Rc<WriteableBitmap>) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for WriteableBitmapRef
impl !Send for WriteableBitmapRef
impl !Sync for WriteableBitmapRef
impl !UnwindSafe for WriteableBitmapRef
impl Freeze for WriteableBitmapRef
impl Unpin for WriteableBitmapRef
impl UnsafeUnpin for WriteableBitmapRef
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more