在线等待回复,欢迎点击

edward0716 2005-03-10 10:35:19

Q:请问在JAVA中如何用矩阵来存储2D图形?

在线等待回复,欢迎点击
...全文
89 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
icebluenet 2005-03-10
其实是一个稀疏矩阵的问题,你应该在有图形的地方把值填充上,比如是黑白的话,把0置为1,如果有灰度的话,在对应位置添上灰度值,如果是彩色的,就要在对应地方添上RGB值。然后,把这个矩阵和页面象素对应。由于图形可能会非常大,所以要用到压缩方法。

嘿嘿,不知道说的对不对,图形学上了很久了。
回复
shuren 2005-03-10
顶!
回复
yyzzhy 2005-03-10
帮你顶!
回复
midlet 2005-03-10
you can store an rgb image using a 3-D array, of which each dimention represents R, G, an B value.
回复
icebluenet 2005-03-10
楼上说的是,假如是灰度图片,则矩阵的元素变成他的灰度值,假如是彩色,矩阵因该是(r,g,b)作为矩阵的元素
回复
thomas_20 2005-03-10
这个矩阵跟下面这个差不多“頂”为0,“█”为1,呵呵
如果有灰度的话“█”或“頂”应该又是一个矩阵代表灰度或rgb吧
不知道这么理解对不对:)

頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂██████████頂頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂████████████████頂頂頂頂
頂頂頂頂頂頂頂頂頂頂████頂頂██████████頂頂頂頂頂頂頂頂頂
頂頂頂頂頂頂████████頂頂██頂頂頂████頂頂頂頂頂頂頂頂頂頂
頂█████████████頂頂頂頂頂頂頂███頂頂頂頂頂頂頂頂頂頂頂
頂███████████頂頂頂頂頂頂頂頂█████████頂頂頂頂頂頂
頂頂█████████頂頂頂頂頂頂頂頂████████████頂頂頂頂
頂頂頂█頂頂頂████頂頂頂頂頂頂████頂頂頂頂頂█████頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂頂██頂頂頂█頂頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂███頂頂頂██頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂███頂頂頂██頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂███頂頂███頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂███頂頂███頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂███頂頂███頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂███頂頂███頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂██頂頂頂██頂頂頂頂███頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂██頂頂頂██頂頂頂頂███頂頂頂頂頂
頂頂頂████████頂頂頂頂頂頂█頂頂██頂頂頂頂████頂頂頂頂頂
頂頂頂頂███████頂頂頂頂頂頂頂頂頂██頂頂█頂頂頂██頂頂頂頂頂
頂頂頂頂頂頂█████頂頂頂頂頂頂頂頂███頂頂████頂頂頂頂頂頂頂
頂頂頂頂頂頂頂頂███頂頂頂頂頂頂頂████頂頂頂██████頂頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂█████頂頂頂頂頂██████頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂████頂頂頂頂頂頂頂頂█████頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂頂█████頂頂頂頂頂頂頂頂頂頂████頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂██頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂██頂頂頂頂
頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂頂
回复
edward0716 2005-03-10
icebluenet(冰蓝泠),能具体点吗?最好能举个简单例子说明一下可以么?谢谢!
回复
发动态
发帖子
Java SE
创建于2007-09-28

6.1w+

社区成员

Java 2 Standard Edition
申请成为版主
社区公告
暂无公告