xlang v5.1 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
QPainter类 参考
QPainter 的协作图:
Collaboration graph

结构体

class  Paint
 

Public 成员函数

成员变量

包属性

详细描述

在文件 QPainter.xcsm5 行定义.

构造及析构函数说明

◆ QPainter() [1/4]

QPainter ( long  handle)

在文件 QPainter.xcsm46 行定义.

46 {
47 hpaint = handle;
48 }
long hpaint
Definition QPainter.xcsm:7

◆ QPainter() [2/4]

QPainter ( @NotNilptr QImage  img) throws IllegalArgumentException

在文件 QPainter.xcsm50 行定义.

50 {
51 hpaint = QtXnl.long_get(img.himage, Constant.PAINTERFROMIMG);
52 if (hpaint == 0) {
53 throw new IllegalArgumentException("paint is null");
54 }
55 bneed_delloc = true;
56 }
bool bneed_delloc
Definition QPainter.xcsm:8

◆ QPainter() [3/4]

QPainter ( ) throws IllegalArgumentException

在文件 QPainter.xcsm57 行定义.

57 {
58 hpaint = QtXnl.long_get(0l, Constant.PAINTERFROMDEVICE);
59 if (hpaint == 0) {
60 throw new IllegalArgumentException("paint is null");
61 }
62 bneed_delloc = true;
63 }

◆ QPainter() [4/4]

QPainter ( @NotNilptr QPaintDevice  device) throws IllegalArgumentException

在文件 QPainter.xcsm64 行定义.

64 {
65 hpaint = QtXnl.long_get(device.nativehandle, Constant.PAINTERFROMDEVICE);
66 if (hpaint == 0) {
67 throw new IllegalArgumentException("paint is null");
68 }
69 bneed_delloc = true;
70 }

成员函数说明

◆ ascent()

int ascent ( )

在文件 QPainter.xcsm285 行定义.

285 {
286 return QtXnl.widget_get_int_value(hpaint, Constant.PAINTFONTASCENT);
287 }

◆ begin()

bool begin ( QPaintDevice  m)

在文件 QPainter.xcsm149 行定义.

149 {
150 return 0 != QtXnl.long_intlong(hpaint, Constant.PAINTBEGIN, m.nativehandle);
151 }

◆ descent()

int descent ( )

在文件 QPainter.xcsm288 行定义.

288 {
289 return QtXnl.widget_get_int_value(hpaint, Constant.PAINTFONTDESCENT);
290 }

◆ drawCircle()

void drawCircle ( int  x,
int  y,
int  r,
Paint  p 
)

在文件 QPainter.xcsm311 行定义.

311 {
312 if (p != nilptr) {
313 setPaint(p);
314 }
315
316 QtXnl.native_int4(hpaint, Constant.DRAWELLIPSE, x - r, y - r, r *2, r * 2);
317 }
void setPaint(@NotNilptr Paint p)
Definition QPainter.xcsm:71

◆ drawImage() [1/2]

void drawImage ( @NotNilptr QImage  image,
@NotNilptr QRect  dest,
@NotNilptr QRect  source,
int  converFlags 
)

在文件 QPainter.xcsm226 行定义.

226 {
227 QtXnl.long_long_int9(hpaint, Constant.DRAWIMAGE, image.himage,
228 dest.left, dest.top, dest.width(), dest.height(),
229 source.left, source.top, source.width(), source.height(),
230 converFlags);
231 }

◆ drawImage() [2/2]

void drawImage ( @NotNilptr QImage  image,
int  x,
int  y 
)

在文件 QPainter.xcsm233 行定义.

233 {
234 QtXnl.widget_set_intlongint_value(hpaint, Constant.DRAWIMAGE, image.himage,x, y);
235 }

◆ drawLine()

void drawLine ( int  start_x,
int  start_y,
int  end_x,
int  end_y 
)

在文件 QPainter.xcsm109 行定义.

109 {
110 QtXnl.native_int4(hpaint, Constant.QXPAINTDRAWLINE, start_x, start_y, end_x, end_y);
111 }

◆ drawLines()

void drawLines ( @NotNilptr int []  points) throws IllegalArgumentException

在文件 QPainter.xcsm181 行定义.

181 {
182 if ((points.length & 1) == 1 || points.length < 4) {
183 throw new IllegalArgumentException("points length must be Even numbers");
184 }
185 QtXnl.array_int2(hpaint, Constant.QXPAINTDRAWLINE, points, 0, 0);
186 }

◆ drawPath() [1/3]

void drawPath ( @NotNilptr QPath  path)

在文件 QPainter.xcsm281 行定义.

281 {
282 QtXnl.widget_set_native_value(hpaint, Constant.DRAWPATH, path.nativehandle);
283 }

◆ drawPath() [2/3]

void drawPath ( @NotNilptr QPath  path,
Paint  paint 
)

在文件 QPainter.xcsm265 行定义.

265 {
266 setPaint(paint);
267 QtXnl.widget_set_native_value(hpaint, Constant.DRAWPATH, path.nativehandle);
268 }

◆ drawPath() [3/3]

void drawPath ( double []  ys,
int  xstep,
int  w,
int  h 
)

在文件 QPainter.xcsm270 行定义.

270 {
271 int wh = ((w << 16) & 0xffff0000) | (h & 0x0000ffff);
272 long v1 = ys.length;
273 v1 = ((v1 << 48) & 0xffff000000000000l) | ((((long)xstep) << 32) & 0x0000ffff00000000l) | (wh & 0x00ffffffffl);
274 QtXnl.pointer_intlong2(ys, Constant.QXPAINTDRAWFLINE, hpaint, v1);
275 }

◆ drawPathf3i()

void drawPathf3i ( double []  ys,
float  start,
float  xstep,
float  yadd,
float  ymul,
int  pos,
int  length 
)

在文件 QPainter.xcsm277 行定义.

277 {
278 QtXnl.pointer_intf3i(hpaint, ys, Constant.QXPAINTDRAWFLINE, start, xstep, yadd, ymul, pos, length);
279 }

◆ drawRect() [1/2]

void drawRect ( @NotNilptr QRect  r)

在文件 QPainter.xcsm117 行定义.

117 {
118 QtXnl.native_int4(hpaint, Constant.QXPAINTDRAWRECT, r.left, r.top, r.width(), r.height());
119 }

◆ drawRect() [2/2]

void drawRect ( int  x,
int  y,
int  w,
int  h 
)

在文件 QPainter.xcsm113 行定义.

113 {
114 QtXnl.native_int4(hpaint, Constant.QXPAINTDRAWRECT, x, y, w, h);
115 }

◆ drawRoundedRect() [1/2]

void drawRoundedRect ( @NotNilptr QRect  r,
int  rx,
int  ry,
Paint  p 
)

在文件 QPainter.xcsm258 行定义.

258 {
259 if (p != nilptr) {
260 setPaint(p);
261 }
262 QtXnl.long_long_int9(hpaint, Constant.ROUNDEDRECT, 0, r.left, r.top, r.width(), r.height(), rx, ry, 0, 0, 0);
263 }

◆ drawRoundedRect() [2/2]

void drawRoundedRect ( int  x,
int  y,
int  w,
int  h,
int  rx,
int  ry,
Paint  p 
)

在文件 QPainter.xcsm244 行定义.

244 {
245 if (p != nilptr) {
246 setPaint(p);
247 }
248 QtXnl.long_long_int9(hpaint, Constant.ROUNDEDRECT, 0, x, y, w, h, rx, ry, 0, 0, 0);
249 }

◆ drawRoundRect() [1/2]

void drawRoundRect ( @NotNilptr QRect  r,
int  rx,
int  ry,
Paint  p 
)

在文件 QPainter.xcsm251 行定义.

251 {
252 if (p != nilptr) {
253 setPaint(p);
254 }
255 QtXnl.long_long_int9(hpaint, Constant.ROUNDRECT, 0, r.left, r.top, r.width(), r.height(), rx, ry, 0, 0, 0);
256 }

◆ drawRoundRect() [2/2]

void drawRoundRect ( int  x,
int  y,
int  w,
int  h,
int  rx,
int  ry,
Paint  p 
)

在文件 QPainter.xcsm237 行定义.

237 {
238 if (p != nilptr) {
239 setPaint(p);
240 }
241 QtXnl.long_long_int9(hpaint, Constant.ROUNDRECT, 0, x, y, w, h, rx, ry, 0, 0, 0);
242 }

◆ drawText() [1/3]

void drawText ( String  text,
int  x,
int  y 
)

在文件 QPainter.xcsm161 行定义.

161 {
162 QtXnl.widget_set_intintstring_value(hpaint, Constant.DRAWTEXT, x, y,text);
163 }

◆ drawText() [2/3]

void drawText ( String  text,
int  x,
int  y,
Paint  p 
)

在文件 QPainter.xcsm170 行定义.

170 {
171 if (p != nilptr) {
172 setPen(p.color, PenStyle.SolidLine, p.width);
173 }
174 QtXnl.widget_set_intintstring_value(hpaint, Constant.DRAWTEXT, x, y,text);
175 }
void setPen(int color, PenStyle penStyle, double width)
Definition QPainter.xcsm:93

◆ drawText() [3/3]

void drawText ( String  text,
QRect  rect,
int  align 
)

在文件 QPainter.xcsm165 行定义.

165 {
166 long x = (((long)rect.left) << 32) | ((long)rect.right& 0xffffffffl), y = (((long)rect.top) << 32) | ((long)rect.bottom & 0xffffffffl);
167 QtXnl.native_long2_string(hpaint, Constant.DRAWTEXT, x, y,align, text);
168 }

◆ end()

bool end ( )

在文件 QPainter.xcsm153 行定义.

153 {
154 return QtXnl.widget_get_int_value(hpaint, Constant.PAINTEND) != 0;
155 }

◆ fillRect() [1/2]

void fillRect ( @NotNilptr QRect  r,
int  color,
int  brushStyle 
)

在文件 QPainter.xcsm177 行定义.

177 {
178 QtXnl.long_long_int9(hpaint, Constant.FILLRECT, 0, r.left, r.top, r.width(), r.height(), color, brushStyle, 0, 0, 0);
179 }

◆ fillRect() [2/2]

void fillRect ( int  x,
int  y,
int  w,
int  h,
int  color,
int  brushStyle 
)

在文件 QPainter.xcsm121 行定义.

121 {
122 QtXnl.long_long_int9(hpaint, Constant.FILLRECT, 0, x, y, w, h, color, brushStyle, 0, 0, 0);
123 }

◆ finalize()

void finalize ( )

在文件 QPainter.xcsm324 行定义.

324 {
325 if (bneed_delloc) {
326 QtXnl.widget_slot(hpaint, Constant.DELLOCPAINTER);
327 bneed_delloc = false;
328 }
329 }

◆ getFont()

QFont getFont ( )

在文件 QPainter.xcsm299 行定义.

299 {
300 return new QFont(QtXnl.long_get(hpaint, Constant.PAINTERGETFCONT));
301 }

◆ getMatrix()

QMatrix getMatrix ( )

在文件 QPainter.xcsm141 行定义.

141 {
142 return new QMatrix(QtXnl.long_get(hpaint, Constant.PAINTERGETMATRIX));
143 }

◆ measureText()

QRect measureText ( int  x,
int  y,
String  text 
)

在文件 QPainter.xcsm319 行定义.

319 {
320 long pt= QtXnl.long_longstring(hpaint, Constant.PAINTMEASURETEXT, 0, text);
321 return new QRect(x, y, x + ((int)(pt >> 32) & 0xffffffff), y + (int)(pt & 0xffffffff));
322 }

◆ resetMatrix()

void resetMatrix ( )

在文件 QPainter.xcsm137 行定义.

137 {
138 QtXnl.widget_slot(hpaint, Constant.PAINTRESETMATRIX);
139 }

◆ resetTransform()

void resetTransform ( )

在文件 QPainter.xcsm157 行定义.

157 {
158 QtXnl.widget_slot(hpaint, Constant.PAINTRESETTRANSFORM);
159 }

◆ restore()

void restore ( )

在文件 QPainter.xcsm133 行定义.

133 {
134 QtXnl.widget_slot(hpaint, Constant.PAINTERRESTORE);
135 }

◆ rotate() [1/2]

void rotate ( double  a)

在文件 QPainter.xcsm208 行定义.

208 {
209 (QtXnl.long_double2(hpaint, Constant.PAINTER_ROTATE, a, 0));
210 }

◆ rotate() [2/2]

void rotate ( double  r,
double  cx,
double  cy 
)

在文件 QPainter.xcsm211 行定义.

211 {
212 (QtXnl.native_double4(r, cx, cy, 0, hpaint, Constant.PAINTER_ROTATE));
213 }

◆ save()

void save ( )

在文件 QPainter.xcsm129 行定义.

129 {
130 QtXnl.widget_slot(hpaint, Constant.PAINTERSAVE);
131 }

◆ scale()

void scale ( double  sx,
double  sy 
)

在文件 QPainter.xcsm200 行定义.

200 {
201 (QtXnl.long_double2(hpaint, Constant.PAINTER_SCALE, sx, sy));
202 }

◆ setAntialiasing()

void setAntialiasing ( bool  ba)

在文件 QPainter.xcsm307 行定义.

307 {
308 setRenderHint(RenderHint.Antialiasing, ba);
309 }
void setRenderHint(int flag, bool on)

◆ setBackgroundBrush()

void setBackgroundBrush ( int  color,
int  brushStyle 
)

在文件 QPainter.xcsm214 行定义.

214 {
215 QtXnl.widget_set_v2int_value(hpaint, Constant.SETBKBRUSH, color, brushStyle);
216 }

◆ setBackMode()

void setBackMode ( int  mode)

在文件 QPainter.xcsm222 行定义.

222 {
223 QtXnl.widget_set_vint_value(hpaint, Constant.QXPAINTBGMMODE, mode);
224 }

◆ setBold()

void setBold ( bool  bb)

在文件 QPainter.xcsm188 行定义.

188 {
189 QtXnl.widget_set_bool_value(hpaint, Constant.PAINTER_SETBOLD, bb);
190 }

◆ setBrush() [1/2]

void setBrush ( @NotNilptr QBrush  brush)

在文件 QPainter.xcsm105 行定义.

105 {
106 QtXnl.widget_set_native_value(hpaint, Constant.SETBRUSH, brush.nativehandle);
107 }

◆ setBrush() [2/2]

void setBrush ( int  color,
QBrush.Style  brushStyle 
)

在文件 QPainter.xcsm101 行定义.

101 {
102 QtXnl.widget_set_v2int_value(hpaint, Constant.SETBRUSH, color, brushStyle);
103 }

◆ setClipRect()

void setClipRect ( int  x,
int  y,
int  w,
int  h,
ClipOperation  op 
)

在文件 QPainter.xcsm125 行定义.

125 {
126 QtXnl.long_long_int9(hpaint, Constant.QXPAINTSETCLIPRECT, 0, x, y, w, h, op, 0, 0, 0, 0);
127 }

◆ setCompositionMode()

void setCompositionMode ( CompositionMode  flag)

在文件 QPainter.xcsm291 行定义.

291 {
292 QtXnl.widget_set_int_bool_value(hpaint, Constant.SETCOMPOSITIONMODE, flag, false);
293 }

◆ setFont()

void setFont ( @NotNilptr QFont  f)

在文件 QPainter.xcsm303 行定义.

303 {
304 QtXnl.widget_set_native_value(hpaint, Constant.PAINTERSETFONT, f.nativehandle);
305 }

◆ setFontPixelSize()

void setFontPixelSize ( int  size)

在文件 QPainter.xcsm89 行定义.

89 {
90 QtXnl.widget_set_vint_value(hpaint, Constant.PAINTFONTPXSIZE, size);
91 }

◆ setFontPointSize()

void setFontPointSize ( int  size)

在文件 QPainter.xcsm85 行定义.

85 {
86 QtXnl.widget_set_vint_value(hpaint, Constant.PAINTFONTPTSIZE, size);
87 }

◆ setItalic()

void setItalic ( bool  bi)

在文件 QPainter.xcsm192 行定义.

192 {
193 QtXnl.widget_set_bool_value(hpaint, Constant.PAINTER_SETITALIC, bi);
194 }

◆ setMatrix()

void setMatrix ( @NotNilptr QMatrix  m)

在文件 QPainter.xcsm145 行定义.

145 {
146 QtXnl.widget_set_native_value(hpaint, Constant.PAINTSETMATRIX, m.nativehandle);
147 }

◆ setOpacity()

void setOpacity ( double  fopacity)

在文件 QPainter.xcsm218 行定义.

218 {
219 QtXnl.widget_set_double_value(hpaint, Constant.QXPAINTOPACITY, fopacity);
220 }

◆ setPaint()

void setPaint ( @NotNilptr Paint  p)

在文件 QPainter.xcsm71 行定义.

71 {
72 if ((p.style & Paint.FILL) != 0) {
73 setBrush(p.color, QBrush.Style.SolidPattern);
74 }
75
76 if ((p.style & Paint.STROKE) != 0) {
77 setPen(p.color, PenStyle.SolidLine, p.width);
78 }
79
80 if (p.textSize >0 ) {
81 setFontPixelSize(p.textSize);
82 }
83 }
void setFontPixelSize(int size)
Definition QPainter.xcsm:89
void setBrush(int color, QBrush.Style brushStyle)

◆ setPen() [1/2]

void setPen ( int  color)

在文件 QPainter.xcsm97 行定义.

97 {
98 QtXnl.widget_set_v2int_double_value(hpaint, Constant.SETPENCLR, color, 0, 0);
99 }

◆ setPen() [2/2]

void setPen ( int  color,
PenStyle  penStyle,
double  width 
)

在文件 QPainter.xcsm93 行定义.

93 {
94 QtXnl.widget_set_v2int_double_value(hpaint, Constant.SETPEN, color, width, penStyle);
95 }

◆ setRenderHint()

void setRenderHint ( int  flag,
bool  on 
)

在文件 QPainter.xcsm295 行定义.

295 {
296 QtXnl.widget_set_int_bool_value(hpaint, Constant.SETRENDERHINT, flag, on);
297 }

◆ shear()

void shear ( double  sh,
double  sv 
)

在文件 QPainter.xcsm204 行定义.

204 {
205 (QtXnl.long_double2(hpaint, Constant.PAINTER_SHEAR, sh, sv));
206 }

◆ translate()

void translate ( double  x,
double  y 
)

在文件 QPainter.xcsm196 行定义.

196 {
197 (QtXnl.long_double2(hpaint, Constant.PAINTER_TRANSLATE, x, y));
198 }

结构体成员变量说明

◆ bneed_delloc

bool bneed_delloc = false
package

在文件 QPainter.xcsm8 行定义.

◆ hpaint

long hpaint

在文件 QPainter.xcsm7 行定义.