阅读:2091回复:2
打开栅格图的delphi代码
看着可以回个贴。谢谢支持。
unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs,inifiles,stdctrls, olectrls, mapxlib_tlb; type tform1 = class(tform) map1: tmap; button1: tbutton; od: topendialog; memo1: tmemo; procedure button1click(sender: tobject); private { private declarations } public { public declarations } end; var form1: tform1; implementation {$r *.dfm} procedure tform1.button1click(sender: tobject); var co:integer; begin od.title :='´ò¿ªî»í¼...'; od.filter :='bmp|*.bmp|jpg|*.jpg|tif|*.tif|all file|*.*'; if od.execute then begin co:=length(od.filename); memo1.lines.clear ; memo1.lines.add('!table'); memo1.lines.add('!version 300'); memo1.lines.add('!charset windowssimpchinese'); memo1.lines.add(' '); memo1.lines.add('definition table'); memo1.lines.add(' file "'+extractfilename(od.filename)+'"'); memo1.lines.add(' type "raster"'); memo1.lines.add(' (0,1) (0,0) label "pt 1",'); memo1.lines.add(' (1,1) (1,0) label "pt 2",'); memo1.lines.add(' (0,0) (0,1) label "pt 3"'); memo1.lines.add(' coordsys nonearth units "ft"'); memo1.lines.add(' units "ft"'); memo1.lines.savetofile(copy(od.filename,1,co-4)+'.tab'); // showmessage(extractfilename(od.filename)); map1.layers.add(copy(od.filename,1,co-4)+'.tab',1) end; end; end. |
|
|
1楼#
发布于:2003-09-26 09:52
贴错了
应当mapx中 |
|
|
2楼#
发布于:2004-04-15 13:33
hao!
|
|