社区
Delphi
帖子详情
怎么定义一个曲线对象?非高手莫入!
ss
2002-06-24 06:35:59
我想画一条曲线,然后能够选中它,能够拖动它!请高手帮忙,提个建议或者有好的VCL组件都可以!
...全文
84
15
打赏
收藏
怎么定义一个曲线对象?非高手莫入!
我想画一条曲线,然后能够选中它,能够拖动它!请高手帮忙,提个建议或者有好的VCL组件都可以!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
15 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
smhpnuaa
2002-07-02
打赏
举报
回复
其实在大富翁上卷大侠有这个专题讲座的,呵呵!
smhpnuaa
2002-07-02
打赏
举报
回复
呵呵,整个代码非常大,包括曲线的拖动,编辑,缩放,保存,加载,还有很多算法在其中。这个也是我目前工作(股票分析软件)的一部分,我可以无偿发给你,但是你不能给其它人阅读!
smhpnuaa
2002-07-02
打赏
举报
回复
呵呵,我已经解决这个问题了,用算法得到曲线上的所有点,呵呵,记录下来,然后定义一个类型,具体我可以给你一个例子!
PLineType=^TLineType;
TLineType=Record
basePoint:Array[0..255] of TPoint;
checkPoint:Array[0..1024] of TPoint;
nCount:integer;
onDrag:Boolean;
end;
//保存
var myLine:PLineType;
Ms:=TMemoryStream.Create;
try
Ms.WriteBuffer(myLine^,sizeof(myLine));
Ms.savetofile('f:\1.dat');
finally
Ms.free;
end;
//创建
New(myLine);
........
Dispose(myLine);
ss
2002-06-27
打赏
举报
回复
大家帮我啊!
delphiws
2002-06-25
打赏
举报
回复
一般的曲线处理(工业中)大多采用B样条曲线,包括常规的圆、直线等都可以通过控制参数表示出来;
曲线拖动与曲线的控制点(可转换为控制参数)有关。
Delphi Workstation
http://delphiws.yeah.net
smhpnuaa
2002-06-25
打赏
举报
回复
到大富翁上找一下!
ss
2002-06-24
打赏
举报
回复
呵呵,给个例子好吗?楼上的大虾!
netlib
2002-06-24
打赏
举报
回复
这纯粹是一个数学问题,
保存时自己定义一个结构类型,即可,
移动时pen.mode:=pmxor,画一编是画线,第二编是擦线,很好用的,也不难,你试试就知道了。
ss
2002-06-24
打赏
举报
回复
哈哈,没有人会吗?
surfguy
2002-06-24
打赏
举报
回复
怎么有点像图像处理程序
smhpnuaa
2002-06-24
打赏
举报
回复
dwg文件格式:
dwg file format
an attempt to specify the dwg (r12) file format using the bff grammar for
binary files.
acknowledgements
i would like to thank reini urban <rurban@sbox.tu-graz.ac.at> for his
contributions.
definition of the elementary elements
typedef word word :=
byte : b1, byte : b2
return (word)f | ((word)s << 8).
typedef longword longp :=
byte : b1, byte : b2, byte : b3, byte : b4
return (longword)b1 | ((longword)b2 << 8)
| ((longword)b3 << 16) | ((longword)b4 << 24).
typedef longword longword :=
byte : b1, byte : b2, byte : b3, byte : b4
return (longword)b1 | ((longword)b2 << 8)
| ((longword)b3 << 16) | ((longword)b4 << 24).
definition of the whole file
root dwg_file :=
[begin : end](
char[12] : version,
byte, word, word, word, byte,
longp : p_entities, longp : p_entend,
longp : p_blocksec, byte[4], longp : p_bsend, byte[4],
tablepos : block_table,
tablepos : layer_table,
tablepos : style_table,
tablepos : ltype_table,
tablepos : view_table,
header, [cur : 0x3ef]byte*,
tablepos : ucs_table, [cur : 0x500]byte*,
tablepos : vport_table, byte[8],
tablepos : appid_table, byte[6],
tablepos : dimstyle_table, [cur : 0x69f]byte*,
tablepos : p13_table, bytes[38],
[p_entities : p_entend]entities : ents, byte[19],
[block_table.start : ]blocks : block_table,
[layer_table.start : ]layers : layer_table,
[style_table.start : ]styles : style_table,
[ltype_table.start : ]ltypes : ltype_table,
[view_table.start : ]table : view_table,
[ucs_table.start : ]table : ucs_table,
[vport_table.start : vport_table.end]table : vport_table,
[appid_table.start : ]appids : appid_table,
[dimstyle_table.start : ]table : dimstyle_table,
[p13_table.start : ]table : p13_table,
[p_blocksec : p_bsend]entities : blocks, bytes[36],
longp = p_entities, longp = p_entend,
longp = blocksec, longp = bsend,
bytes[12],
bytes[6],
longp = block_table.start, bytes[6],
longp = layer_table.start, bytes[6],
longp = style_table.start, bytes[6],
longp = ltype_table.start, bytes[6]
longp = view_table.start, bytes[6],
longp = ucs_table.start, bytes[6],
longp = vport_table.start, bytes[6],
longp = appid_table.start, bytes[6],
longp = dimstyle_table.start, bytes[6],
longp = p13_table.start, bytes[6],
longp bytes*,
).
a table position
tablepos :=
word : size,
long : nr,
long : start,
the header
header :=
word,
point(true) : inbase,
point(true) : extmin,
point(true) : extmax,
point(false) : limmin,
point(false) : limmax,
double[4],
byte[2],
double[2],
byte[56],
double[3],
byte[18],
double .
the block table
blocks :=
( [size](
byte : flag,
char[32] : name,
word : used,
byte, word, byte, word,
check_2
)
)[nr] : blocks_info,
check_32.
check_2 := byte[2].
check_32 := byte[32].
the layer table
layers :=
( [size](
byte : flag,
char[32] : name,
word : used,
word : color,
word : style,
check_2
)
)[nr] : layer_info,
check_32.
the style table
styles :=
( [size](
byte : flag,
char[32] : name,
word, double[3], byte, double, char[128],
check_2
)
)[nr] : style_info,
check_32.
the line-type table
ltypes :=
( [size](
byte : flag,
char[32] : name,
word, char[48], byte,
byte, double[13],
check_2
)
)[nr] : ltype_info,
check_32 .
the application identifier table
appids :=
( [size](
byte : flag,
char[32] : name,
word,
check_2
)
)[nr] : appid_info,
check_32 .
the other tables
table :=
( [size](
byte : flag,
[size - 3]byte*,
check_2
)
)[nr],
check_32 .
the entities
(experimental)
entities :=
( byte : kind,
byte : flag,
word : length,
[length - 4](
word : layer,
word : opts,
if (flag & 1) then byte : color else color = 0 fi,
if (flag & 0x40) then byte : extra else extra = 0 fi,
if (extra & 2) then xdata fi,
if (flag & 2) then word : type fi,
if (flag & 4 && kind > 2 && kind != 22) then double : z fi,
if (flag & 8) then double : th fi,
if (flag & 0x20) then handle fi,
if (extra & 4) then word : paper fi,
smhpnuaa
2002-06-24
打赏
举报
回复
呵呵!
用这个组件吧_http://www.8421.org/download.php?id=137
netlib
2002-06-24
打赏
举报
回复
记住曲线的所在椭圆的坐标,
和画线的起和结束位置,
然后判断,纯粹是数学问题、
smhpnuaa
2002-06-24
打赏
举报
回复
失量图的绘制需要:
1)图形学的相关知识——图元(的表示),图元的显示(用户
坐标系与窗口坐标系),图形变换(平移、旋转等)。
2)数据文件的存储——链表操作
具体:
所有可显示的图形——通称图元可以分为三类——点、线、面,其中点是最基本的概念
,点可以是一个抽象的坐标也可以是有具体形状、位置的图形(如圆、正方形等),线是由
一系列点的集合,面是封闭的线加上面属性。它们的数据结构可表示:
点图元数据:坐标数据(X,Y),点属性数据(如形状、大小、色彩、编码(ID码)等)
线图元数据:点数目,各点的坐标数据(数组)、线属性数据
面图元数据:点数目,各点的坐标数据(数组)、面属性数据
2)显示图形时,坐标数据确定图形的位置,但注意用户坐标到屏幕坐标的转换。属性数据
确定图形的形状、颜色、线条等。
3)图形的放缩是通过用户坐标到屏幕坐标的转换实现的。至于保存图形数据,三类图元
分别采用三个链表进行保存比较方便。无论是编辑、查询、保存文件,都可以通过对
链表的操作实现。
ss
2002-06-24
打赏
举报
回复
up者都有分?
VC++
曲线
绘制技术实战详解:GDI与GDI+绘图全解析
借助变换矩阵,你可以轻松实现: - 螺旋展开动画 - 镜像翻转 - 透视投影(配合复合路径) GraphicsPath:构建复杂图形的终极工具 当你要画一个既有直线、又有弧线、还有贝塞尔
曲线
的复合图形时, GraphicsPath 就是...
DeepSeek + 自媒体文案分析:还在为文章二创发愁?一键拆解长文!
结构化分析一篇文章所有元素:结构、立意、素材、文采、逻辑链。
定义文本编辑器
接上一篇3、应用范例:定义文本编辑器3.1、前言 一个文本编辑器主要处理的问题有 文件保存格式的定义,文档保存为文本格式还是二进制格式的,文档中各个信息单元保存什么信息。文档格式很重要。 和文档存储系统的...
查理·芒格的 100 个思维模型是什么?一文弄懂多元思维模型!
查理·芒格的 100 个思维模型(多元思维模型)是一套多学科融合的思考框架,旨在帮助个人或组织做出更明智的决策。
月入十万,难吗?
琬逸 ,认真回答,对关注者timeline负责 韩冬、 Naiyan Wang、 钢盅郭子 等 11873 人赞同 ...歪个楼,反对 @蓝海 这种欺骗性极强的答案。信了,真正赚钱的就是骗子,而不是你。...每个车主每
Delphi
5,930
社区成员
262,943
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章