Trait winsafe::prelude::ole_IPicture

source ·
pub trait ole_IPicture: ole_IUnknown {
    // Provided methods
    fn get_CurDC(&self) -> HrResult<HDC> { ... }
    fn get_Height(&self) -> HrResult<i32> { ... }
    fn get_Type(&self) -> HrResult<PICTYPE> { ... }
    fn get_Width(&self) -> HrResult<i32> { ... }
    fn PictureChanged(&self) -> HrResult<()> { ... }
    fn put_KeepOriginalFormat(&self, keep: bool) -> HrResult<()> { ... }
    fn Render(
        &self,
        hdc: &HDC,
        dest_pt: POINT,
        dest_sz: SIZE,
        src_offset: Option<POINT>,
        src_extent: SIZE,
        metafile_bounds: Option<&RECT>
    ) -> HrResult<()> { ... }
    fn SelectPicture(&self, hdc: &HDC) -> HrResult<(HDC, HBITMAP)> { ... }
}
Available on crate features kernel and ole only.
Expand description

This trait is enabled with the ole feature, and provides methods for IPicture.

Prefer importing this trait through the prelude:

use winsafe::prelude::*;

Provided Methods§

source

fn get_CurDC(&self) -> HrResult<HDC>

source

fn get_Height(&self) -> HrResult<i32>

IPicture::get_Height method.

Note: Returns a value in HIMETRIC units. To convert it to pixels, use HDC::HiMetricToPixel.

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

let pic: w::IPicture; // initialized somewhere

let hdc = w::HWND::NULL.GetDC()?;

let (_, height) = hdc.HiMetricToPixel(0, pic.get_Height()?);
println!("Height: {} px", height);
source

fn get_Type(&self) -> HrResult<PICTYPE>

source

fn get_Width(&self) -> HrResult<i32>

IPicture::get_Width method.

Note: Returns a value in HIMETRIC units. To convert it to pixels, use HDC::HiMetricToPixel.

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

let pic: w::IPicture; // initialized somewhere

let hdc = w::HWND::NULL.GetDC()?;

let (width, _) = hdc.HiMetricToPixel(pic.get_Width()?, 0);
println!("Width: {} px", width);
source

fn PictureChanged(&self) -> HrResult<()>

source

fn put_KeepOriginalFormat(&self, keep: bool) -> HrResult<()>

source

fn Render( &self, hdc: &HDC, dest_pt: POINT, dest_sz: SIZE, src_offset: Option<POINT>, src_extent: SIZE, metafile_bounds: Option<&RECT> ) -> HrResult<()>

source

fn SelectPicture(&self, hdc: &HDC) -> HrResult<(HDC, HBITMAP)>

Object Safety§

This trait is not object safe.

Implementors§