pub struct RenderTargetBitmap { /* private fields */ }Expand description
A bitmap that holds the rendering of a visual.
Implementations§
Source§impl RenderTargetBitmap
impl RenderTargetBitmap
Sourcepub fn new(pixel_size: PixelSize) -> RenderTargetBitmap
pub fn new(pixel_size: PixelSize) -> RenderTargetBitmap
Creates a bitmap of the given size, in pixels, at 96 DPI.
Sourcepub fn with_dpi(pixel_size: PixelSize, dpi: Vector) -> RenderTargetBitmap
pub fn with_dpi(pixel_size: PixelSize, dpi: Vector) -> RenderTargetBitmap
Creates a bitmap of the given size, in pixels, and DPI.
Sourcepub fn platform_impl(&self) -> &RefCounted<dyn IRenderTargetBitmapImpl>
pub fn platform_impl(&self) -> &RefCounted<dyn IRenderTargetBitmapImpl>
The platform-specific bitmap implementation.
Sourcepub fn create_drawing_context(&self) -> DrawingContext<'static>
pub fn create_drawing_context(&self) -> DrawingContext<'static>
Creates a drawing context that draws into the bitmap, after clearing the bitmap. Disposing (or dropping) the context finishes the drawing.
Sourcepub fn create_drawing_context_with_clear(
&self,
clear: bool,
) -> DrawingContext<'static>
pub fn create_drawing_context_with_clear( &self, clear: bool, ) -> DrawingContext<'static>
Creates a drawing context that draws into the bitmap, clearing the
bitmap first when clear is set.
Sourcepub fn create_platform_drawing_context(
&self,
clear: bool,
) -> Box<dyn IDrawingContextImpl>
pub fn create_platform_drawing_context( &self, clear: bool, ) -> Box<dyn IDrawingContextImpl>
Creates the platform drawing context that draws into the bitmap,
clearing the bitmap first when clear is set.
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<SharedBitmapImpl>
pub fn platform_impl(&self) -> &RefCounted<SharedBitmapImpl>
The platform-specific bitmap implementation.
Sourcepub fn save_to_file(
&self,
file_name: &str,
options: &BitmapEncoderOptions,
) -> Result<()>
pub fn save_to_file( &self, file_name: &str, options: &BitmapEncoderOptions, ) -> Result<()>
Saves the bitmap to a file.
Sourcepub fn save(
&self,
stream: &mut dyn Write,
options: &BitmapEncoderOptions,
) -> Result<()>
pub fn save( &self, stream: &mut dyn Write, options: &BitmapEncoderOptions, ) -> Result<()>
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 Deref for RenderTargetBitmap
impl Deref for RenderTargetBitmap
Source§impl IBitmap for RenderTargetBitmap
impl IBitmap for RenderTargetBitmap
Source§fn pixel_size(&self) -> PixelSize
fn pixel_size(&self) -> PixelSize
Source§fn platform_impl(&self) -> &RefCounted<SharedBitmapImpl>
fn platform_impl(&self) -> &RefCounted<SharedBitmapImpl>
Source§impl IImage for RenderTargetBitmap
impl IImage for RenderTargetBitmap
Source§fn draw(
&self,
context: &mut DrawingContext<'_>,
source_rect: Rect,
dest_rect: Rect,
)
fn draw( &self, context: &mut DrawingContext<'_>, source_rect: Rect, dest_rect: Rect, )
source_rect is drawn into dest_rect.Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
as_object.Source§fn as_object(&self) -> Option<&FerroObject>
fn as_object(&self) -> Option<&FerroObject>
Source§fn as_affects_render(&self) -> Option<&dyn IAffectsRender>
fn as_affects_render(&self) -> Option<&dyn IAffectsRender>
IAffectsRender, when it can change.Source§impl IImageBrushSource for RenderTargetBitmap
impl IImageBrushSource for RenderTargetBitmap
Source§fn bitmap(&self) -> Option<&RefCounted<SharedBitmapImpl>>
fn bitmap(&self) -> Option<&RefCounted<SharedBitmapImpl>>
Source§fn get_bitmap(&self) -> Option<Arc<SharedBitmapImpl>>
fn get_bitmap(&self) -> Option<Arc<SharedBitmapImpl>>
Auto Trait Implementations§
impl !Freeze for RenderTargetBitmap
impl RefUnwindSafe for RenderTargetBitmap
impl Send for RenderTargetBitmap
impl Sync for RenderTargetBitmap
impl Unpin for RenderTargetBitmap
impl UnsafeUnpin for RenderTargetBitmap
impl UnwindSafe for RenderTargetBitmap
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
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