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§
sourcefn get_CurDC(&self) -> HrResult<HDC>
fn get_CurDC(&self) -> HrResult<HDC>
IPicture::get_CurDC
method.
sourcefn get_Height(&self) -> HrResult<i32>
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);
sourcefn get_Type(&self) -> HrResult<PICTYPE>
fn get_Type(&self) -> HrResult<PICTYPE>
IPicture::get_Type
method.
sourcefn get_Width(&self) -> HrResult<i32>
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);
sourcefn PictureChanged(&self) -> HrResult<()>
fn PictureChanged(&self) -> HrResult<()>
IPicture::PictureChanged
method.
sourcefn put_KeepOriginalFormat(&self, keep: bool) -> HrResult<()>
fn put_KeepOriginalFormat(&self, keep: bool) -> HrResult<()>
IPicture::put_KeepOriginalFormat
method.
sourcefn Render(
&self,
hdc: &HDC,
dest_pt: POINT,
dest_sz: SIZE,
src_offset: Option<POINT>,
src_extent: SIZE,
metafile_bounds: Option<&RECT>
) -> HrResult<()>
fn Render( &self, hdc: &HDC, dest_pt: POINT, dest_sz: SIZE, src_offset: Option<POINT>, src_extent: SIZE, metafile_bounds: Option<&RECT> ) -> HrResult<()>
IPicture::Render
method.
sourcefn SelectPicture(&self, hdc: &HDC) -> HrResult<(HDC, HBITMAP)>
fn SelectPicture(&self, hdc: &HDC) -> HrResult<(HDC, HBITMAP)>
IPicture::SelectPicture
method.
Object Safety§
This trait is not object safe.