happyboy75
路人甲
路人甲
  • 注册日期2003-07-27
  • 发帖数89
  • QQ
  • 铜币667枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2333回复:5

画圆角矩形了(delphi6+mapx4.5)源码?

楼主#
更多 发布于:2003-09-09 08:15
完全正常

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.
喜欢0 评分0
想换工作:现在的工作有点偏离GIS 求职意向:GIS应用与开发(mo、mapx、mapengine) 开发语言:vb、delphi 数据库:SQL server、DB2 happyboy075@163.com qq:122761955
happyboy75
路人甲
路人甲
  • 注册日期2003-07-27
  • 发帖数89
  • QQ
  • 铜币667枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2003-09-12 11:38
是不是很差,怎么每人反映
想换工作:现在的工作有点偏离GIS 求职意向:GIS应用与开发(mo、mapx、mapengine) 开发语言:vb、delphi 数据库:SQL server、DB2 happyboy075@163.com qq:122761955
举报 回复(0) 喜欢(0)     评分
再别康桥
路人甲
路人甲
  • 注册日期2003-08-16
  • 发帖数268
  • QQ
  • 铜币760枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2003-10-08 16:13
不是啦,好多人是用VB的,看不懂
不知道怎么反映呀
呵呵
轻轻的我一如天边的云 轻轻的走过你的身旁 在你的心中划下淡淡的痕 难忘 ------------------------------------- http://www.21trip.com 世纪之旅欢迎您!!
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
3楼#
发布于:2003-10-15 21:32
绝对的支持你!
举报 回复(0) 喜欢(0)     评分
superyc227
路人甲
路人甲
  • 注册日期2004-01-30
  • 发帖数22
  • QQ
  • 铜币152枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2005-02-27 19:26
好,支持
举报 回复(0) 喜欢(0)     评分
litaowmd
路人甲
路人甲
  • 注册日期2004-02-26
  • 发帖数50
  • QQ
  • 铜币108枚
  • 威望0点
  • 贡献值0点
  • 银元0个
5楼#
发布于:2005-03-12 13:25
<P>楼上的,希望多帖出来些关于这方面的源码,大家向你学习!</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部