pub struct OfdPageGraphics2D {
pub page_width: f64,
pub page_height: f64,
pub draw_param: OfdGraphics2DDrawParam,
pub object_count: u32,
}Expand description
OFD 页面 2D 图形上下文。
对应 Java: org.ofdrw.graphics2d.OFDPageGraphics2D
绑定到单个 OFD 页面的绘图上下文,持有当前绘制参数和页面尺寸。
Java 版提供完整的 Graphics2D API(drawLine / fillRect / drawString 等);
Rust 版保留上下文状态,具体绘制由上层引擎实现。
Fields§
§page_width: f64页面宽度(mm)。
page_height: f64页面高度(mm)。
draw_param: OfdGraphics2DDrawParam当前绘制参数。
object_count: u32已绘制的对象计数。
Implementations§
Source§impl OfdPageGraphics2D
impl OfdPageGraphics2D
Sourcepub fn draw_param(self, param: OfdGraphics2DDrawParam) -> Self
pub fn draw_param(self, param: OfdGraphics2DDrawParam) -> Self
设置绘制参数。
Sourcepub fn page_width(&self) -> f64
pub fn page_width(&self) -> f64
获取页面宽度。
Sourcepub fn page_height(&self) -> f64
pub fn page_height(&self) -> f64
获取页面高度。
Sourcepub fn object_count(&self) -> u32
pub fn object_count(&self) -> u32
获取已绘制对象数。
Sourcepub fn increment_object_count(&mut self)
pub fn increment_object_count(&mut self)
增加对象计数(模拟绘制操作)。
Trait Implementations§
Source§impl Clone for OfdPageGraphics2D
impl Clone for OfdPageGraphics2D
Source§fn clone(&self) -> OfdPageGraphics2D
fn clone(&self) -> OfdPageGraphics2D
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OfdPageGraphics2D
impl RefUnwindSafe for OfdPageGraphics2D
impl Send for OfdPageGraphics2D
impl Sync for OfdPageGraphics2D
impl Unpin for OfdPageGraphics2D
impl UnsafeUnpin for OfdPageGraphics2D
impl UnwindSafe for OfdPageGraphics2D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more