阅读:2573回复:5
画圆角矩形了(delphi6+mapx4.5)源码?
完全正常
unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls, olectrls, mapxlib_tlb,comctrls; type tform1 = class(tform) map1: tmap; button4: tbutton; procedure formcreate(sender: tobject); procedure map1toolused(sender: tobject; toolnum: smallint; x1, y1, x2, y2, distance: double; shift, ctrl: wordbool; var enabledefault: wordbool); procedure button4click(sender: tobject); private { private declarations } lyr:mapxlib_tlb.layer; public { public declarations } end; var form1: tform1; implementation {$r *.dfm} procedure tform1.formcreate(sender: tobject); begin map1.createcustomtool(123,1,1); lyr:=map1.layers.item(1); lyr.editable :=true; map1.layers.insertionlayer :=lyr; map1.mapunit:=7; end; procedure tform1.map1toolused(sender: tobject; toolnum: smallint; x1, y1, x2, y2, distance: double; shift, ctrl: wordbool; var enabledefault: wordbool); var bx,by,ex,ey:single; ps:mapxlib_tlb.point; pss:mapxlib_tlb.points; ftr:mapxlib_tlb.feature; begin ps:=copoint.create ; pss:=copoints.create ; if toolnum=123 then begin map1.convertcoord(bx,by,x1,y1,mimaptoscreen); map1.convertcoord(ex,ey,x2,y2,mimaptoscreen); // if ex-bx>ey-by then if ey-by>8 then begin ps.set_(x1,y1); pss.add(ps,1); ps.set_(x2,y1); pss.add(ps,2); ps.set_(x2,y2); pss.add(ps,3); ps.set_(x1,y2); pss.add(ps,4); ftr:=map1.featurefactory.createregion(pss,map1.defaultstyle ); ftr:=map1.featurefactory.bufferfeatures(ftr,distance*4/(ey-by),7,255); map1.layers.item(1).addfeature(ftr,emptyparam); end; if ex-bx<ey-by then if ex-ey>8 then begin ps.set_(x1,y1); pss.add(ps,1); ps.set_(x2,y1); pss.add(ps,2); ps.set_(x2,y2); pss.add(ps,3); ps.set_(x1,y2); pss.add(ps,4); ftr:=map1.featurefactory.createregion(pss,map1.defaultstyle ); ftr:=map1.featurefactory.bufferfeatures(ftr,distance*4/(ex-bx),7,255); map1.layers.item(1).addfeature(ftr,emptyparam); end; end; pss.removeall ; end; procedure tform1.button4click(sender: tobject); begin map1.currenttool :=123; end; end. |
|
|
1楼#
发布于:2005-03-12 13:25
<P>楼上的,希望多帖出来些关于这方面的源码,大家向你学习!</P>
|
|
2楼#
发布于:2005-02-27 19:26
好,支持
|
|
3楼#
发布于:2003-10-15 21:32
绝对的支持你!
|
|
|
4楼#
发布于:2003-10-08 16:13
不是啦,好多人是用VB的,看不懂
不知道怎么反映呀 呵呵 |
|
|
5楼#
发布于:2003-09-12 11:38
是不是很差,怎么每人反映
|
|
|