Struct winsafe::HDC

source ·
pub struct HDC(/* private fields */);
Available on crate feature user only.
Expand description

Handle to a device context.

Trait Implementations§

source§

impl Debug for HDC

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for HDC

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Handle for HDC

source§

const NULL: Self = _

Available on crate feature kernel only.
The null, uninitialized handle; equals to 0.
source§

const INVALID: Self = _

Available on crate feature kernel only.
The invalid handle; equals to -1. Read more
source§

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

Available on crate feature kernel only.
Creates a new handle object by wrapping a pointer. Read more
source§

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

Available on crate feature kernel only.
Returns a mutable reference to the underlying raw pointer. Read more
source§

unsafe fn raw_copy(&self) -> Self

Available on crate feature kernel only.
Returns a raw copy of the underlying handle pointer. Read more
source§

fn ptr(&self) -> *mut c_void

Available on crate feature kernel only.
Returns the underlying raw pointer. Read more
source§

fn as_opt(&self) -> Option<&Self>

Available on crate feature kernel only.
Returns None if the handle is null or invalid, otherwise returns Some(&self). Read more
source§

impl Hash for HDC

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for HDC

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PartialEq for HDC

source§

fn eq(&self, other: &HDC) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl UpperHex for HDC

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl gdi_Hdc for HDC

Available on crate feature gdi only.
source§

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

AborthPath function.
source§

fn AlphaBlend( &self, origin_dest: RECT, hdc_src: &HDC, origin_src: RECT, ftn: &BLENDFUNCTION ) -> SysResult<()>

AlphaBlend function.
source§

fn AngleArc( &self, center: POINT, radius: u32, start_angle: f32, sweep_angle: f32 ) -> SysResult<()>

AngleArc function.
source§

fn Arc( &self, bound: RECT, radial_start: POINT, radial_end: POINT ) -> SysResult<()>

Arc function.
source§

fn ArcTo( &self, bound: RECT, radial_start: POINT, radial_end: POINT ) -> SysResult<()>

ArcTo function.
source§

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

BeginPath function.
source§

fn BitBlt( &self, dest_pos: POINT, sz: SIZE, hdc_src: &HDC, src_src: POINT, rop: ROP ) -> SysResult<()>

BitBlt function.
source§

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

CancelDC function.
source§

fn Chord( &self, bounds: RECT, start_radial: POINT, end_radial: POINT ) -> SysResult<()>

Chord function.
source§

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

CloseFigure function.
source§

fn CreateCompatibleBitmap( &self, cx: i32, cy: i32 ) -> SysResult<DeleteObjectGuard<HBITMAP>>

source§

fn CreateCompatibleDC(&self) -> SysResult<DeleteDCGuard>

source§

fn CreateHalftonePalette(&self) -> SysResult<DeleteObjectGuard<HPALETTE>>

source§

fn Ellipse(&self, bound: RECT) -> SysResult<()>

Ellipse function.
source§

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

EndPath function.
source§

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

FillPath function.
source§

fn FillRect(&self, rc: RECT, hbr: &HBRUSH) -> SysResult<()>

FillRect function.
source§

fn FillRgn(&self, rgn: &HRGN, brush: &HBRUSH) -> SysResult<()>

FillRgn function.
source§

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

FlattenPath function.
source§

fn FrameRgn(&self, rgn: &HRGN, brush: &HBRUSH, w: i32, h: i32) -> SysResult<()>

FrameRgn function.
source§

fn GetBkColor(&self) -> SysResult<COLORREF>

GetBkColor function.
source§

fn GetBkMode(&self) -> SysResult<BKMODE>

GetBkMode function.
source§

fn GetDCBrushColor(&self) -> SysResult<COLORREF>

GetDCBrushColor function.
source§

fn GetDCPenColor(&self) -> SysResult<COLORREF>

GetDCPenColor function.
source§

unsafe fn GetDIBits( &self, hbm: &HBITMAP, first_scan_line: u32, num_scan_lines: u32, bmp_data_buf: Option<&mut [u8]>, bmi: &mut BITMAPINFO, usage: DIB ) -> SysResult<i32>

source§

fn GetDeviceCaps(&self, index: GDC) -> i32

GetDeviceCaps function.
source§

fn GetStretchBltMode(&self) -> SysResult<STRETCH_MODE>

source§

fn GetTextColor(&self) -> SysResult<COLORREF>

GetTextColor function.
source§

fn GetTextExtentPoint32(&self, text: &str) -> SysResult<SIZE>

source§

fn GetTextFace(&self) -> SysResult<String>

GetTextFace function.
source§

fn GetTextMetrics(&self, tm: &mut TEXTMETRIC) -> SysResult<()>

GetTextMetrics function.
source§

fn GetViewportExtEx(&self) -> SysResult<SIZE>

source§

fn GetViewportOrgEx(&self) -> SysResult<POINT>

source§

fn GetWindowExtEx(&self) -> SysResult<SIZE>

GetWindowExtEx function.
source§

fn GetWindowOrgEx(&self) -> SysResult<POINT>

GetWindowOrgEx function.
source§

fn HiMetricToPixel(&self, x: i32, y: i32) -> (i32, i32)

source§

fn LineTo(&self, x: i32, y: i32) -> SysResult<()>

LineTo function.
source§

fn MoveToEx(&self, x: i32, y: i32, pt: Option<&mut POINT>) -> SysResult<()>

MoveToEx function.
source§

fn PatBlt(&self, top_left: POINT, sz: SIZE, rop: ROP) -> SysResult<()>

PatBlt function.
source§

fn PathToRegion(&self) -> SysResult<DeleteObjectGuard<HRGN>>

PathToRegion function.
source§

fn Pie(&self, bounds: RECT, radial_1: POINT, radial_2: POINT) -> SysResult<()>

Pie function.
source§

fn PixelToHiMetric(&self, x: i32, y: i32) -> (i32, i32)

source§

fn PolyBezier(&self, pts: &[POINT]) -> SysResult<()>

PolyBezier function.
source§

fn PolyBezierTo(&self, pts: &[POINT]) -> SysResult<()>

PolyBezierTo function.
source§

fn Polyline(&self, pts: &[POINT]) -> SysResult<()>

Polyline function.
source§

fn PolylineTo(&self, pts: &[POINT]) -> SysResult<()>

PolylineTo function.
source§

fn PtVisible(&self, x: i32, y: i32) -> SysResult<bool>

PtVisible function.
source§

fn RealizePalette(&self) -> SysResult<u32>

RealizePalette function.
source§

fn Rectangle(&self, bounds: RECT) -> SysResult<()>

Rectangle function.
source§

fn RestoreDC(&self, saved_dc: i32) -> SysResult<()>

RestoreDC function.
source§

fn RoundRect(&self, bounds: RECT, sz: SIZE) -> SysResult<()>

RoundRect function.
source§

fn SaveDC(&self) -> SysResult<i32>

SaveDC function.
source§

fn SelectClipPath(&self, mode: RGN) -> SysResult<()>

SelectClipPath function.
source§

fn SelectClipRgn(&self, rgn: &HRGN) -> SysResult<REGION>

SelectClipRgn function.
source§

fn SelectObject<G>( &self, hgdiobj: &G ) -> SysResult<SelectObjectGuard<'_, Self, G>>
where G: GdiObjectSelect,

source§

fn SelectPalette( &self, hpal: &HPALETTE, force_bkgd: bool ) -> SysResult<Option<HPALETTE>>

SelectPalette function.
source§

fn SetArcDirection(&self, dir: AD) -> SysResult<AD>

SetArcDirection function.
source§

fn SetBkColor(&self, color: COLORREF) -> SysResult<COLORREF>

SetBkColor function.
source§

fn SetBkMode(&self, mode: BKMODE) -> SysResult<BKMODE>

SetBkMode function.
source§

fn SetBrushOrgEx(&self, new_origin: POINT) -> SysResult<POINT>

SetBrushOrgEx function.
source§

fn SetDCBrushColor(&self, color: COLORREF) -> SysResult<COLORREF>

SetDCBrushColor function.
source§

fn SetDCPenColor(&self, color: COLORREF) -> SysResult<COLORREF>

SetDCPenColor function.
source§

fn SetDIBits( &self, hbm: &HBITMAP, first_scan_line: u32, num_scan_lines: u32, dib_color_data: &[u8], bmi: &BITMAPINFO, color_use: DIB ) -> SysResult<i32>

SetDIBits function.
source§

fn SetGraphicsMode(&self, mode: GM) -> SysResult<GM>

SetGraphicsMode function.
source§

fn SetStretchBltMode(&self, mode: STRETCH_MODE) -> SysResult<STRETCH_MODE>

source§

fn SetTextAlign(&self, align: TA) -> SysResult<TA>

SetTextAlign function.
source§

fn SetTextColor(&self, color: COLORREF) -> SysResult<COLORREF>

SetTextColor function.
source§

fn SetTextJustification(&self, extra: i32, count: i32) -> SysResult<()>

source§

fn SetViewportExtEx(&self, x: i32, y: i32) -> SysResult<SIZE>

source§

fn SetViewportOrgEx(&self, x: i32, y: i32) -> SysResult<POINT>

source§

fn SetWindowExtEx(&self, x: i32, y: i32) -> SysResult<SIZE>

SetWindowExtEx function.
source§

fn SetWindowOrgEx(&self, x: i32, y: i32) -> SysResult<POINT>

SetWindowOrgEx function.
source§

fn StretchBlt( &self, pos_dest: POINT, sz_dest: SIZE, hdc_src: &HDC, pt_src: POINT, sz_src: SIZE, rop: ROP ) -> SysResult<()>

StretchBlt function.
source§

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

source§

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

StrokePath function.
source§

fn TextOut(&self, x: i32, y: i32, text: &str) -> SysResult<()>

TextOut function.
source§

fn TransparentBlt( &self, dest_top_left: POINT, dest_sz: SIZE, hdc_src: HDC, src_top_left: POINT, src_sz: SIZE, color_transparent: COLORREF ) -> SysResult<()>

TransparentBlt function.
source§

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

UpdateColors function.
source§

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

WidenPath function.
source§

impl user_Hdc for HDC

source§

fn DrawFocusRect(&self, rect: &RECT) -> SysResult<()>

DrawFocusRect function.
source§

fn DrawText(&self, text: &str, bounds: &RECT, format: DT) -> SysResult<i32>

DrawText function.
source§

fn DrawTextEx( &self, text: &str, bounds: &RECT, format: DT, dtp: Option<&DRAWTEXTPARAMS> ) -> SysResult<i32>

DrawTextExW function.
source§

fn EnumDisplayMonitors<F>( &self, rc_clip: Option<RECT>, func: F ) -> SysResult<()>
where F: FnMut(HMONITOR, HDC, &RECT) -> bool,

source§

fn InvertRect(&self, rc: &RECT) -> SysResult<()>

InvertRect function.
source§

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

PaintDesktop function.
source§

fn WindowFromDC(&self) -> Option<HWND>

WindowFromDC function.
source§

impl Eq for HDC

source§

impl Send for HDC

source§

impl StructuralPartialEq for HDC

Auto Trait Implementations§

§

impl Freeze for HDC

§

impl RefUnwindSafe for HDC

§

impl !Sync for HDC

§

impl Unpin for HDC

§

impl UnwindSafe for HDC

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> 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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

§

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.