[−][src]Struct direct2d::device_context::DeviceContext
Methods
impl DeviceContext
[src]
pub fn create(device: &Device) -> D2DResult<DeviceContext>
[src]
pub fn set_target(&mut self, target: &Image)
[src]
Methods from Deref<Target = RenderTarget>
pub fn size(&self) -> Sizef
[src]
pub fn pixel_size(&self) -> Sizeu
[src]
pub fn begin_draw(&mut self)
[src]
pub fn end_draw(&mut self) -> Result<(), (Error, Option<RenderTag>)>
[src]
pub fn set_tag(&mut self, tag: Option<RenderTag>)
[src]
pub fn get_tag(&self) -> Option<RenderTag>
[src]
pub fn flush(&mut self) -> Result<(), (Error, Option<RenderTag>)>
[src]
pub fn clear(&mut self, color: impl Into<Color>)
[src]
pub fn draw_line(
&mut self,
p0: impl Into<Point2f>,
p1: impl Into<Point2f>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
[src]
&mut self,
p0: impl Into<Point2f>,
p1: impl Into<Point2f>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
pub fn draw_rectangle(
&mut self,
rect: impl Into<Rectf>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
[src]
&mut self,
rect: impl Into<Rectf>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
pub fn fill_rectangle(&mut self, rect: impl Into<Rectf>, brush: &Brush)
[src]
pub fn draw_rounded_rectangle(
&mut self,
rect: impl Into<RoundedRect>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
[src]
&mut self,
rect: impl Into<RoundedRect>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
pub fn fill_rounded_rectangle(
&mut self,
rect: impl Into<RoundedRect>,
brush: &Brush
)
[src]
&mut self,
rect: impl Into<RoundedRect>,
brush: &Brush
)
pub fn draw_ellipse(
&mut self,
ellipse: impl Into<Ellipse>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
[src]
&mut self,
ellipse: impl Into<Ellipse>,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
pub fn fill_ellipse(&mut self, ellipse: impl Into<Ellipse>, brush: &Brush)
[src]
pub fn draw_geometry(
&mut self,
geometry: &Geometry,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
[src]
&mut self,
geometry: &Geometry,
brush: &Brush,
stroke_width: f32,
stroke_style: Option<&StrokeStyle>
)
pub fn fill_geometry(&mut self, geometry: &Geometry, brush: &Brush)
[src]
pub fn fill_geometry_with_opacity(
&mut self,
geometry: &Geometry,
brush: &Brush,
opacity_brush: &Brush
)
[src]
&mut self,
geometry: &Geometry,
brush: &Brush,
opacity_brush: &Brush
)
pub fn draw_bitmap(
&mut self,
bitmap: &Bitmap,
dest_rect: impl Into<Rectf>,
opacity: f32,
interpolation: BitmapInterpolationMode,
src_rect: impl Into<Rectf>
)
[src]
&mut self,
bitmap: &Bitmap,
dest_rect: impl Into<Rectf>,
opacity: f32,
interpolation: BitmapInterpolationMode,
src_rect: impl Into<Rectf>
)
pub fn draw_text(
&mut self,
text: &str,
format: &TextFormat,
layout_rect: impl Into<Rectf>,
foreground_brush: &Brush,
options: DrawTextOptions
)
[src]
&mut self,
text: &str,
format: &TextFormat,
layout_rect: impl Into<Rectf>,
foreground_brush: &Brush,
options: DrawTextOptions
)
pub fn draw_text_layout(
&mut self,
origin: impl Into<Point2f>,
layout: &TextLayout,
brush: &Brush,
options: DrawTextOptions
)
[src]
&mut self,
origin: impl Into<Point2f>,
layout: &TextLayout,
brush: &Brush,
options: DrawTextOptions
)
pub fn set_transform(&mut self, transform: &Matrix3x2f)
[src]
pub fn transform(&self) -> Matrix3x2f
[src]
pub fn set_antialias_mode(&mut self, mode: AntialiasMode)
[src]
pub fn antialias_mode(&mut self) -> UncheckedEnum<AntialiasMode>
[src]
pub fn set_dpi(&mut self, dpi_x: f32, dpi_y: f32)
[src]
pub fn dpi(&self) -> (f32, f32)
[src]
pub fn push_layer<'a, 'b>(
&'a mut self,
layer: &'b Layer
) -> LayerBuilder<'a, 'b> where
Self: Sized + 'a,
[src]
&'a mut self,
layer: &'b Layer
) -> LayerBuilder<'a, 'b> where
Self: Sized + 'a,
pub fn pop_layer(&mut self)
[src]
pub fn push_axis_aligned_clip(
&mut self,
clip: impl Into<Rectf>,
aa: AntialiasMode
)
[src]
&mut self,
clip: impl Into<Rectf>,
aa: AntialiasMode
)
pub fn pop_axis_aligned_clip(&mut self)
[src]
Trait Implementations
impl RenderTargetType for DeviceContext
[src]
fn try_cast<R: RenderTargetType>(self) -> Option<R> where
Self: Sized,
[src]
Self: Sized,
Try to cast this factory to a different factory type
fn try_with_cast<R: RenderTargetType, V>(
&self,
f: impl FnOnce(&R) -> V
) -> Option<V>
[src]
&self,
f: impl FnOnce(&R) -> V
) -> Option<V>
Try to temporarily upcast this type to perform an operation
impl Sync for DeviceContext
[src]
impl Send for DeviceContext
[src]
impl DerefMut for DeviceContext
[src]
fn deref_mut(&mut self) -> &mut RenderTarget
[src]
impl Deref for DeviceContext
[src]
type Target = RenderTarget
The resulting type after dereferencing.
fn deref(&self) -> &RenderTarget
[src]
impl Debug for DeviceContext
[src]
impl ComWrapper for DeviceContext
[src]
type Interface = ID2D1DeviceContext
The raw interface type from winapi
unsafe fn get_raw(&self) -> *mut Self::Interface
[src]
unsafe fn into_raw(self) -> *mut Self::Interface
[src]
unsafe fn from_raw(raw: *mut Self::Interface) -> Self
[src]
unsafe fn from_ptr(ptr: ComPtr<Self::Interface>) -> Self
[src]
unsafe fn into_ptr(self) -> ComPtr<Self::Interface>
[src]
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> FontKey for T where
T: Send + Sync + 'static + ?Sized,
[src]
T: Send + Sync + 'static + ?Sized,