Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java GUI 设计  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 关于裁剪区对绘图的影响
bookong





发贴: 5
积分: 0
于 2006-07-26 13:34 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Graphics对象中可以通过setClip方法来设置裁剪区,对于画到裁剪区以外的部分是不显示的。
我的问题是,假如有一个Image对象,我要将它画到一个Graphics对象上(通过drawImage方法)。那么整个Image都在setClip设置的裁剪区内和只有部分Image在setClip设置的裁剪区之内这两种情况下,系统实际消耗的时间是否一样呢?因为drawImage方法是立即返回的,我不知道怎么来试验测试,希望大家给个思路。
假设部分Image在裁剪区之内时系统消耗的时间要比全部Image在裁剪区之内消耗的系统时间要少的话。对于一个Image对象,如果我先将它的一半设置在裁剪区内,然后drawImage一下,再把另一半设置在裁剪区内drawImage一下。它与一次将Image整个地drawImage,谁消耗的时间少呢?



作者 Re:关于裁剪区对绘图的影响 [Re:bookong]
bookong





发贴: 5
积分: 0
于 2006-07-27 13:31 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
没有高手点拨一下吗?


作者 Re:关于裁剪区对绘图的影响 [Re:bookong]
ranchgirl



版主


发贴: 801
积分: 132
于 2006-07-29 21:32 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
If you want to save time, you can slice the image, draw all (e.g.)odd slices to let user see a rough image first, complete it (draw the even slices).

This technique is used on the internet almost everywhere now.

There might exist api to do that, do a google search...

Good luck!





作者 Re:关于裁剪区对绘图的影响 [Re:bookong]
ranchgirl



版主


发贴: 801
积分: 132
于 2006-07-29 21:34 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Another thing you can do is put the draw part in another thread, draw outscreen image first, then put it in.





flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923