Trait winsafe::prelude::gdi_Hbrush

source ·
pub trait gdi_Hbrush: Handle {
    // Provided methods
    fn from_sys_color(color: COLOR) -> HBRUSH { ... }
    fn CreateBrushIndirect(
        lb: &LOGBRUSH
    ) -> SysResult<DeleteObjectGuard<HBRUSH>> { ... }
    fn CreateHatchBrush(
        hatch: HS,
        color: COLORREF
    ) -> SysResult<DeleteObjectGuard<HBRUSH>> { ... }
    fn CreatePatternBrush(
        hbmp: &HBITMAP
    ) -> SysResult<DeleteObjectGuard<HBRUSH>> { ... }
    fn CreateSolidBrush(color: COLORREF) -> SysResult<DeleteObjectGuard<HBRUSH>> { ... }
    fn GetObject(&self, pv: &mut LOGBRUSH) -> SysResult<()> { ... }
    fn GetStockObject(sb: STOCK_BRUSH) -> SysResult<HBRUSH> { ... }
    fn GetSysColorBrush(index: COLOR) -> SysResult<HBRUSH> { ... }
    fn UnrealizeObject(&self) -> SysResult<()> { ... }
}
Available on crate features kernel and gdi only.
Expand description

This trait is enabled with the gdi feature, and provides methods for HBRUSH.

Prefer importing this trait through the prelude:

use winsafe::prelude::*;

Provided Methods§

source

fn from_sys_color(color: COLOR) -> HBRUSH

Creates a brush with the given system color.

Note: This should be used only to initialize the WNDCLASSEX’s hbrBackground field. Any other use will yield an invalid handle.

source

fn CreateBrushIndirect(lb: &LOGBRUSH) -> SysResult<DeleteObjectGuard<HBRUSH>>

source

fn CreateHatchBrush( hatch: HS, color: COLORREF ) -> SysResult<DeleteObjectGuard<HBRUSH>>

CreateHatchBrush function.

source

fn CreatePatternBrush(hbmp: &HBITMAP) -> SysResult<DeleteObjectGuard<HBRUSH>>

source

fn CreateSolidBrush(color: COLORREF) -> SysResult<DeleteObjectGuard<HBRUSH>>

CreateSolidBrush function.

source

fn GetObject(&self, pv: &mut LOGBRUSH) -> SysResult<()>

GetObject function.

§Examples
use winsafe::{self as w, prelude::*};

let hbr: w::HBRUSH; // initialized somewhere

let mut brush = w::LOGBRUSH::default();
hbr.GetObject(&mut brush)?;
source

fn GetStockObject(sb: STOCK_BRUSH) -> SysResult<HBRUSH>

GetStockObject function.

source

fn GetSysColorBrush(index: COLOR) -> SysResult<HBRUSH>

GetSysColorBrush function.

source

fn UnrealizeObject(&self) -> SysResult<()>

UnrealizeObject function.

Object Safety§

This trait is not object safe.

Implementors§