pub struct BitmapIsOwned<const OWNED: bool>(/* private fields */);
Expand description
This class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour or colour with alpha channel support.
Bitmap
represents a C++wxBitmap
class instance which your code has ownership,BitmapIsOwned
<false>
represents one which don’t own.- Use
Bitmap
’snew()
orBuildable::builder()
(if available) to create an instance of this class. - See C++
wxBitmap
class’s documentation for more details.
Implementations§
Source§impl<const OWNED: bool> BitmapIsOwned<OWNED>
impl<const OWNED: bool> BitmapIsOwned<OWNED>
Sourcepub fn new() -> BitmapIsOwned<OWNED>
pub fn new() -> BitmapIsOwned<OWNED>
Default constructor.
Sourcepub fn new_with_bitmap<B: BitmapMethods>(bitmap: &B) -> BitmapIsOwned<OWNED>
pub fn new_with_bitmap<B: BitmapMethods>(bitmap: &B) -> BitmapIsOwned<OWNED>
Copy constructor, uses reference counting.
Sourcepub fn new_with_int_int(
width: c_int,
height: c_int,
depth: c_int,
) -> BitmapIsOwned<OWNED>
pub fn new_with_int_int( width: c_int, height: c_int, depth: c_int, ) -> BitmapIsOwned<OWNED>
Creates a new bitmap.
Sourcepub fn new_with_size<S: SizeMethods>(
sz: &S,
depth: c_int,
) -> BitmapIsOwned<OWNED>
pub fn new_with_size<S: SizeMethods>( sz: &S, depth: c_int, ) -> BitmapIsOwned<OWNED>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sourcepub fn new_with_int_dc<D: DCMethods>(
width: c_int,
height: c_int,
dc: &D,
) -> BitmapIsOwned<OWNED>
pub fn new_with_int_dc<D: DCMethods>( width: c_int, height: c_int, dc: &D, ) -> BitmapIsOwned<OWNED>
Create a bitmap compatible with the given DC, inheriting its magnification factor.
Sourcepub fn new_with_char(bits: *const c_void) -> BitmapIsOwned<OWNED>
pub fn new_with_char(bits: *const c_void) -> BitmapIsOwned<OWNED>
Creates a bitmap from XPM data.
Sourcepub fn new_with_image_int<I: ImageMethods>(
img: &I,
depth: c_int,
) -> BitmapIsOwned<OWNED>
pub fn new_with_image_int<I: ImageMethods>( img: &I, depth: c_int, ) -> BitmapIsOwned<OWNED>
Creates this bitmap object from the given image.
Sourcepub fn new_with_image_dc<I: ImageMethods, D: DCMethods>(
img: &I,
dc: &D,
) -> BitmapIsOwned<OWNED>
pub fn new_with_image_dc<I: ImageMethods, D: DCMethods>( img: &I, dc: &D, ) -> BitmapIsOwned<OWNED>
Creates a bitmap compatible with the given DC from the given image.
Sourcepub fn new_with_cursor<C: CursorMethods>(cursor: &C) -> BitmapIsOwned<OWNED>
pub fn new_with_cursor<C: CursorMethods>(cursor: &C) -> BitmapIsOwned<OWNED>
Creates bitmap corresponding to the given cursor.
pub fn none() -> Option<&'static Self>
Trait Implementations§
Source§impl<const OWNED: bool> BitmapMethods for BitmapIsOwned<OWNED>
impl<const OWNED: bool> BitmapMethods for BitmapIsOwned<OWNED>
Source§fn convert_to_image(&self) -> Image
fn convert_to_image(&self) -> Image
Creates an image from a platform-dependent bitmap. Read more
Source§fn copy_from_icon<I: IconMethods>(&self, icon: &I) -> bool
fn copy_from_icon<I: IconMethods>(&self, icon: &I) -> bool
Creates the bitmap from an icon. Read more
Source§fn create_int_int(&self, width: c_int, height: c_int, depth: c_int) -> bool
fn create_int_int(&self, width: c_int, height: c_int, depth: c_int) -> bool
Creates a fresh bitmap. Read more
Source§fn create_size<S: SizeMethods>(&self, sz: &S, depth: c_int) -> bool
fn create_size<S: SizeMethods>(&self, sz: &S, depth: c_int) -> bool
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Read more
Source§fn create_int_dc<D: DCMethods>(
&self,
width: c_int,
height: c_int,
dc: &D,
) -> bool
fn create_int_dc<D: DCMethods>( &self, width: c_int, height: c_int, dc: &D, ) -> bool
Create a bitmap compatible with the given DC, inheriting its magnification factor. Read more
Source§fn create_with_dip_size_size<S: SizeMethods>(
&self,
size: &S,
scale: c_double,
depth: c_int,
) -> bool
fn create_with_dip_size_size<S: SizeMethods>( &self, size: &S, scale: c_double, depth: c_int, ) -> bool
Create a bitmap specifying its size in DPI-independent pixels and the scale factor to use. Read more
Source§fn create_with_dip_size_int(
&self,
width: c_int,
height: c_int,
scale: c_double,
depth: c_int,
) -> bool
fn create_with_dip_size_int( &self, width: c_int, height: c_int, scale: c_double, depth: c_int, ) -> bool
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Read more
Source§fn create_scaled(
&self,
width: c_int,
height: c_int,
depth: c_int,
logical_scale: c_double,
) -> bool
fn create_scaled( &self, width: c_int, height: c_int, depth: c_int, logical_scale: c_double, ) -> bool
Create a bitmap with a scale factor. Read more
Source§fn get_dip_size(&self) -> Size
fn get_dip_size(&self) -> Size
Returns the size of bitmap in DPI-independent units. Read more
Source§fn get_height(&self) -> c_int
fn get_height(&self) -> c_int
Returns the height of the bitmap in physical pixels. Read more
Source§fn get_logical_height(&self) -> c_double
fn get_logical_height(&self) -> c_double
Returns the height of the bitmap in logical pixels. Read more
Source§fn get_logical_size(&self) -> Size
fn get_logical_size(&self) -> Size
Returns the size of the bitmap in logical pixels. Read more
Source§fn get_logical_width(&self) -> c_double
fn get_logical_width(&self) -> c_double
Returns the width of the bitmap in logical pixels. Read more
Source§fn get_mask(&self) -> Option<MaskIsOwned<false>>
fn get_mask(&self) -> Option<MaskIsOwned<false>>
Gets the associated mask (if any) which may have been loaded from a file or set for the bitmap. Read more
Source§fn get_palette(&self) -> Option<PaletteIsOwned<false>>
fn get_palette(&self) -> Option<PaletteIsOwned<false>>
Gets the associated palette (if any) which may have been loaded from a file or set for the bitmap. Read more
Source§fn get_sub_bitmap<R: RectMethods>(&self, rect: &R) -> Bitmap
fn get_sub_bitmap<R: RectMethods>(&self, rect: &R) -> Bitmap
Returns a sub bitmap of the current one as long as the rect belongs entirely to the bitmap. Read more
Source§fn get_scale_factor(&self) -> c_double
fn get_scale_factor(&self) -> c_double
Returns the scale factor of this bitmap. Read more
Source§fn get_scaled_height(&self) -> c_double
fn get_scaled_height(&self) -> c_double
Returns the height of the bitmap in logical pixels. Read more
Source§fn get_scaled_size(&self) -> Size
fn get_scaled_size(&self) -> Size
Returns the size of the bitmap in logical pixels. Read more
Source§fn get_scaled_width(&self) -> c_double
fn get_scaled_width(&self) -> c_double
Returns the width of the bitmap in logical pixels. Read more
Source§fn set_scale_factor(&self, scale: c_double)
fn set_scale_factor(&self, scale: c_double)
Sets the bitmap scale factor. Read more
Source§fn set_palette<P: PaletteMethods>(&self, palette: &P)
fn set_palette<P: PaletteMethods>(&self, palette: &P)
Sets the associated palette. Read more
Source§fn add_handler<B: BitmapHandlerMethods>(handler: Option<&B>)
fn add_handler<B: BitmapHandlerMethods>(handler: Option<&B>)
Adds a handler to the end of the static list of format handlers. Read more
Source§fn clean_up_handlers()
fn clean_up_handlers()
Deletes all bitmap handlers. Read more
Source§fn find_handler(name: &str) -> Option<BitmapHandlerIsOwned<false>>
fn find_handler(name: &str) -> Option<BitmapHandlerIsOwned<false>>
Finds the handler with the given name. Read more
Source§fn init_standard_handlers()
fn init_standard_handlers()
Adds the standard bitmap format handlers, which, depending on wxWidgets configuration, can be handlers for Windows bitmap, Windows bitmap resource, and XPM. Read more
Source§fn insert_handler<B: BitmapHandlerMethods>(handler: Option<&B>)
fn insert_handler<B: BitmapHandlerMethods>(handler: Option<&B>)
Adds a handler at the start of the static list of format handlers. Read more
Source§fn new_from_png_data(data: *const c_void, size: usize) -> Bitmap
fn new_from_png_data(data: *const c_void, size: usize) -> Bitmap
Loads a bitmap from the memory containing image data in PNG format. Read more
Source§fn remove_handler(name: &str) -> bool
fn remove_handler(name: &str) -> bool
Finds the handler with the given name, and removes it. Read more
Source§fn rescale<B: BitmapMethods, S: SizeMethods>(bmp: &B, size_needed: &S)
fn rescale<B: BitmapMethods, S: SizeMethods>(bmp: &B, size_needed: &S)
Rescale the given bitmap to the requested size. Read more
Source§impl Clone for BitmapIsOwned<false>
impl Clone for BitmapIsOwned<false>
Source§impl<const OWNED: bool> Drop for BitmapIsOwned<OWNED>
impl<const OWNED: bool> Drop for BitmapIsOwned<OWNED>
Source§impl<const OWNED: bool> DynamicCast for BitmapIsOwned<OWNED>
impl<const OWNED: bool> DynamicCast for BitmapIsOwned<OWNED>
fn class_info() -> ClassInfoIsOwned<false>
fn as_unowned<T>(&self) -> Option<<T as WxRustMethods>::Unowned>where
T: DynamicCast,
Source§impl<const OWNED: bool> From<BitmapIsOwned<OWNED>> for GDIObjectIsOwned<OWNED>
impl<const OWNED: bool> From<BitmapIsOwned<OWNED>> for GDIObjectIsOwned<OWNED>
Source§fn from(o: BitmapIsOwned<OWNED>) -> Self
fn from(o: BitmapIsOwned<OWNED>) -> Self
Converts to this type from the input type.
Source§impl<const OWNED: bool> From<BitmapIsOwned<OWNED>> for ObjectIsOwned<OWNED>
impl<const OWNED: bool> From<BitmapIsOwned<OWNED>> for ObjectIsOwned<OWNED>
Source§fn from(o: BitmapIsOwned<OWNED>) -> Self
fn from(o: BitmapIsOwned<OWNED>) -> Self
Converts to this type from the input type.
Source§impl From<BitmapIsOwned<true>> for BitmapBundle
impl From<BitmapIsOwned<true>> for BitmapBundle
Source§impl<const OWNED: bool> ObjectMethods for BitmapIsOwned<OWNED>
impl<const OWNED: bool> ObjectMethods for BitmapIsOwned<OWNED>
Source§fn get_class_info(&self) -> Option<ClassInfoIsOwned<false>>
fn get_class_info(&self) -> Option<ClassInfoIsOwned<false>>
This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). Read more
Source§fn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>>
fn get_ref_data(&self) -> Option<ObjectRefDataIsOwned<false>>
Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. Read more
Source§fn is_kind_of<C>(&self, info: Option<&C>) -> boolwhere
C: ClassInfoMethods,
fn is_kind_of<C>(&self, info: Option<&C>) -> boolwhere
C: ClassInfoMethods,
Determines whether this class is a subclass of (or the same class as) the given class. Read more
Source§fn is_same_as<O>(&self, obj: &O) -> boolwhere
O: ObjectMethods,
fn is_same_as<O>(&self, obj: &O) -> boolwhere
O: ObjectMethods,
Returns true if this object has the same data pointer as obj. Read more
Source§fn ref_<O>(&self, clone: &O)where
O: ObjectMethods,
fn ref_<O>(&self, clone: &O)where
O: ObjectMethods,
Makes this object refer to the data in clone. Read more
Source§fn set_ref_data<O>(&self, data: Option<&O>)where
O: ObjectRefDataMethods,
fn set_ref_data<O>(&self, data: Option<&O>)where
O: ObjectRefDataMethods,
Sets the wxObject::m_refData pointer. Read more
Source§fn un_ref(&self)
fn un_ref(&self)
Decrements the reference count in the associated data, and if it is zero, deletes the data. Read more
This is the same of AllocExclusive() but this method is public. Read more
Source§impl<const OWNED: bool> WxRustMethods for BitmapIsOwned<OWNED>
impl<const OWNED: bool> WxRustMethods for BitmapIsOwned<OWNED>
type Unowned = BitmapIsOwned<false>
unsafe fn as_ptr(&self) -> *mut c_void
unsafe fn from_ptr(ptr: *mut c_void) -> Self
unsafe fn from_unowned_ptr(ptr: *mut c_void) -> Self::Unowned
unsafe fn with_ptr<F: Fn(&Self)>(ptr: *mut c_void, closure: F)
unsafe fn option_from(ptr: *mut c_void) -> Option<Self::Unowned>where
Self: Sized,
impl<const OWNED: bool> GDIObjectMethods for BitmapIsOwned<OWNED>
Auto Trait Implementations§
impl<const OWNED: bool> Freeze for BitmapIsOwned<OWNED>
impl<const OWNED: bool> RefUnwindSafe for BitmapIsOwned<OWNED>
impl<const OWNED: bool> !Send for BitmapIsOwned<OWNED>
impl<const OWNED: bool> !Sync for BitmapIsOwned<OWNED>
impl<const OWNED: bool> Unpin for BitmapIsOwned<OWNED>
impl<const OWNED: bool> UnwindSafe for BitmapIsOwned<OWNED>
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