Struct BitmapIsOwned

Source
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.

Implementations§

Source§

impl<const OWNED: bool> BitmapIsOwned<OWNED>

Source

pub fn new() -> BitmapIsOwned<OWNED>

Source

pub fn new_with_bitmap<B: BitmapMethods>(bitmap: &B) -> BitmapIsOwned<OWNED>

Copy constructor, uses reference counting.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

pub fn new_with_int_int( width: c_int, height: c_int, depth: c_int, ) -> BitmapIsOwned<OWNED>

Creates a new bitmap.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

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.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

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.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

pub fn new_with_char(bits: *const c_void) -> BitmapIsOwned<OWNED>

Creates a bitmap from XPM data.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

pub fn new_with_image_int<I: ImageMethods>( img: &I, depth: c_int, ) -> BitmapIsOwned<OWNED>

Creates this bitmap object from the given image.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

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.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

pub fn new_with_cursor<C: CursorMethods>(cursor: &C) -> BitmapIsOwned<OWNED>

Creates bitmap corresponding to the given cursor.

See C++ wxBitmap::wxBitmap()’s documentation.

Source

pub fn none() -> Option<&'static Self>

Trait Implementations§

Source§

impl<const OWNED: bool> BitmapMethods for BitmapIsOwned<OWNED>

Source§

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

Creates the bitmap from an icon. Read more
Source§

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

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

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

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

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

Create a bitmap with a scale factor. Read more
Source§

fn get_depth(&self) -> c_int

Gets the colour depth of the bitmap. Read more
Source§

fn get_dip_size(&self) -> Size

Returns the size of bitmap in DPI-independent units. Read more
Source§

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

Returns the height of the bitmap in logical pixels. Read more
Source§

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

Returns the width of the bitmap in logical pixels. Read more
Source§

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>>

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

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

Returns the scale factor of this bitmap. Read more
Source§

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

Returns the size of the bitmap in logical pixels. Read more
Source§

fn get_scaled_width(&self) -> c_double

Returns the width of the bitmap in logical pixels. Read more
Source§

fn get_size(&self) -> Size

Returns the size of the bitmap in physical pixels. Read more
Source§

fn get_width(&self) -> c_int

Returns the width of the bitmap in physical pixels. Read more
Source§

fn has_alpha(&self) -> bool

Returns true if the bitmap has an alpha channel. Read more
Source§

fn is_ok(&self) -> bool

Returns true if bitmap data is present. Read more
Source§

fn set_scale_factor(&self, scale: c_double)

Sets the bitmap scale factor. Read more
Source§

fn set_mask<M: MaskMethods>(&self, mask: Option<&M>)

Sets the mask for this bitmap. Read more
Source§

fn set_palette<P: PaletteMethods>(&self, palette: &P)

Sets the associated palette. Read more
Source§

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()

Deletes all bitmap handlers. Read more
Source§

fn find_handler(name: &str) -> Option<BitmapHandlerIsOwned<false>>

Finds the handler with the given name. Read more
Source§

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>)

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

Loads a bitmap from the memory containing image data in PNG format. Read more
Source§

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)

Rescale the given bitmap to the requested size. Read more
Source§

impl Clone for BitmapIsOwned<false>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const OWNED: bool> Drop for BitmapIsOwned<OWNED>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<const OWNED: bool> DynamicCast for BitmapIsOwned<OWNED>

Source§

impl<const OWNED: bool> From<BitmapIsOwned<OWNED>> for GDIObjectIsOwned<OWNED>

Source§

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>

Source§

fn from(o: BitmapIsOwned<OWNED>) -> Self

Converts to this type from the input type.
Source§

impl From<BitmapIsOwned<true>> for BitmapBundle

Source§

fn from(bitmap: Bitmap) -> Self

Converts to this type from the input type.
Source§

impl<const OWNED: bool> ObjectMethods for BitmapIsOwned<OWNED>

Source§

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>>

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>) -> bool

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) -> bool
where 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,

Makes this object refer to the data in clone. Read more
Source§

fn set_ref_data<O>(&self, data: Option<&O>)

Sets the wxObject::m_refData pointer. Read more
Source§

fn un_ref(&self)

Decrements the reference count in the associated data, and if it is zero, deletes the data. Read more
Source§

fn un_share(&self)

This is the same of AllocExclusive() but this method is public. Read more
Source§

impl<const OWNED: bool> WxRustMethods for BitmapIsOwned<OWNED>

Source§

type Unowned = BitmapIsOwned<false>

Source§

unsafe fn as_ptr(&self) -> *mut c_void

Source§

unsafe fn from_ptr(ptr: *mut c_void) -> Self

Source§

unsafe fn from_unowned_ptr(ptr: *mut c_void) -> Self::Unowned

Source§

unsafe fn with_ptr<F: Fn(&Self)>(ptr: *mut c_void, closure: F)

Source§

unsafe fn option_from(ptr: *mut c_void) -> Option<Self::Unowned>
where Self: Sized,

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.