package com.xx.watch; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import javax.imageio.ImageIO; /** *MZ.java *com.xx.watch *工程:bird *功能:TODO *author date time *李星星 2014-2-27 下午5:43:07 *Email:hai5253@163.com *copytight (C) 2014 ,INI All Rights Reserved. */ public class MZ { int x; int y; int width; int height; double agnle=0; BufferedImage image; public MZ(int x,int y,double m) throws IOException{ image = ImageIO.read(getClass().getResource("mz.png")); this.height = image.getHeight(); this.width = image.getWidth(); this.x = x/2-width/2; this.y = y/2-height+5; this.agnle = (Math.PI/30)*m; } public void step(){ agnle= agnle+(Math.PI/30); if(agnle>(2*Math.PI))agnle=0; } public synchronized void paint(Graphics g){ Graphics2D g2 = (Graphics2D)g; g2.rotate(agnle, this.x+width/2, this.y+height-5); g2.drawImage(image, x, y,null); g2.rotate(-agnle, this.x+width/2, this.y+height-5); } }
最近下载更多
Willson88888 LV3
2022年12月7日
飘逸人 LV4
2022年11月17日
mannka LV2
2022年6月28日
Demo1111 LV30
2021年12月12日
最代码-宋家辉 LV61
2021年11月30日
woaini001987 LV1
2020年11月16日
谷凤宇 LV10
2020年5月29日
wei112233 LV15
2020年4月2日
15966848095 LV22
2020年1月12日
y1214435276 LV9
2019年9月25日
最近浏览更多
drawing
2023年11月6日
暂无贡献等级
qq1434100519 LV1
2023年11月1日
2385649653 LV7
2023年6月25日
aweixianng
2023年6月24日
暂无贡献等级
WZXYYS
2023年6月5日
暂无贡献等级
SILKYYY
2023年5月25日
暂无贡献等级
111168
2023年5月21日
暂无贡献等级
微信网友_6425728903319552 LV1
2023年4月9日
Willson88888 LV3
2022年12月7日
飘逸人 LV4
2022年11月17日