社区
Delphi
帖子详情
怎么定义一个曲线对象?非高手莫入!
ss
2002-06-24 06:35:59
我想画一条曲线,然后能够选中它,能够拖动它!请高手帮忙,提个建议或者有好的VCL组件都可以!
...全文
30
15
打赏
收藏
微信扫一扫
点击复制链接
分享
下载分享明细
分享
举报
写回复
15 条
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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者都有分?
打赏
举报
回复
赞
相关推荐
随意用鼠标画一条
曲线
然后修改这条
曲线
在CStatic控件中,已经实现了坐标移动,缩小,放大等功能,控件中的
曲线
也已经显示出来。 目前能够做到的最大程度就是放大很多倍数,直接拖动数据点来改变
曲线
的形状,只能
一个
数 据点
一个
数据点的修改(绝对的体力活,因为数据太多),然后缩小成正常形状。 数据来源有两种方式: ①从文本文件中读取一系列的数据点,在控件上显示为一条不规则的
曲线
; ②任意用鼠标画一条不规则的
曲线
; 请问:怎么修改这条
曲线
? 主要想达到CorelDraw中用手绘工具画一条任意
曲线
,然后可以拖动控制点来改变
曲线
但是我不知道他
寻求一算法!(急!急!!)
在JAVA小程序中根据给定的坐标系中点的数据画一条平滑
曲线
的算法。比如根据5个或6个点的坐标画一条
曲线
,不知哪位
高手
能够帮忙!有这样的程序亦可。重谢!!
怎么样画
曲线
?
已知A,B两点的坐标,我想画一条尽量直的
曲线
把这两点连接起来,不知道有什么函数可以实现。 如果能连接多点的更好。 大家帮忙想想办法,先谢谢了。。
JFreeChart画
一个
曲线
图,上下坐标单位不一样
具体是这样的,想画
一个
曲线
图分析ping,X轴为时间轴,Y轴正向坐标想画一条
曲线
显示平均时间,负向坐标想画一条
曲线
显示丢失的百分比,请问用JFreeChart可以实现吗?怎么实现? PS:或者各位
高手
有什么其他更好的想法可以通过
曲线
图分析平均时间和丢失,请告诉我吧
发帖
Delphi
加入
微信扫一扫
点击复制链接
分享社区
下载分享明细
5091
社区成员
26.2w+
社区内容
Delphi 开发及应用
社区管理员
申请成为版主
帖子事件
创建了帖子
2002-06-24 06:35
社区公告
暂无公告