Apple
来源:互联网 发布:起爆点指标公式源码 编辑:程序博客网 时间:2024/04/29 16:36
import java.awt.*; import java.applet.*; public class Apple extends Applet{ int width, height; Image image; Graphics draw_Curve; public void init(){ setBackground(Color.black); this.setSize(350, 310); width = getSize().width; height = getSize().height; image = createImage(width, height); draw_Curve = image.getGraphics(); } public void paint(Graphics g){ draw_Curve.clearRect(0, 0, width, height); draw_Curve.setColor(Color.red); int i, j; double x, y, r; for(i = 0; i <= 90; i++) for(j = 0; j <= 90; j++){ r = Math.PI / 45 * i * (1 - Math.sin(Math.PI / 45 * j)) * 18; x = r * Math.cos(Math.PI / 45 * j) * Math.sin(Math.PI / 45 * i) + width / 2; y = -r * Math.sin(Math.PI / 45 * j) + height / 4; draw_Curve.fillOval((int) x, (int)y, 2, 2); } g.drawImage(image, 0, 0, this); } }
copy过来的,只是想借助其来编程一个心形图形,但是心形图是由不同的文字组成。
0 0
- Apple
- Apple
- APPLE
- Apple
- Apple
- Once Apple, Forever Apple
- Apple 广告曲
- Apple市场信息
- Apple iPad
- bad apple
- Apple application
- Apple Catching
- Apple Inc.
- Apple学习
- Faster Apple
- apple 99¥
- Apple APN
- Apple Apps
- Excel2003默认调色板颜色索引对照表
- 阿里实习生招聘笔试题目
- 刷新物化视图脚本
- 1006. 求和游戏--最大子数列求和(子数列长度大于1)
- sqlserver 锁
- Apple
- 给技术人上的管理课:激励与授权
- 查询执行中的存储过程
- Kaldi学习笔记——The Kaldi Speech Recognition Toolkit(Kaldi语音识别工具箱)(下)
- 使用jquery插件实现图片延迟加载技术
- MFC 剪贴板使用完全攻略
- 性能测试方案简述
- 安装libpng出现configure: error: ZLib not installed
- Web渗透测试攻略 [一]