dmppainter.cpp
864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**************************************************************************
* file: dmpdrawingboard.cpp
* Author: qingxiongf
* Date: 2021-08-05 17:59:11
* Email: qingxiongf@chinadci.com
* copyright: 广州城市信息研究所有限公司
***************************************************************************/
DmpPainter::DmpPainter(cairo_surface_t* surface)
{
psurface_ = surface;
pcairo_ = cairo_create(surface);
}
DmpPainter::DmpPainter(cairo_surface_t* surface,int width,int height,bool isimage)
{
psurface_ = surface;
pcairo_ = cairo_create(surface);
}
DmpPainter::~DmpPainter()
{
if (psurface_)
{
cairo_surface_destroy(psurface_);
psurface_ = NULL;
}
if(pcairo_)
{
cairo_surface_destroy(pcairo_);
pcairo_ = NULL;
}
}