-
Java中的Canvas绘图源码实例
Java中的Canvas绘图源码实例,主要是画线条、弧线、圆角矩形、三角形、文字、圆形等简单的几何图形,主要是通过创建DrawingCanvas对象canvas,为canvas设置命令监听者,实现接口CommandListener的方法,把缓冲区图像的内容绘制到画布上,画图部分代码:
int w = getWidth(); // 画布的宽度
int h = getHeight(); // 画布的高度
Image buffer = Image.createImage(w, h); // 用于绘图的缓冲图像
Graphics gc = buffer.getGraphics(); // 获取缓冲图像的图形环境
// 清除画布
public void clearScreen() {
gc.setColor(255,255,255); // 设置绘图颜色为白色
gc.fillRect(0,0,w,h); // 把缓冲图像填充为白色
gc.setColor(255,0,0); // 设置绘图颜色为红色
}
// 绘制直线
public void drawLine() {
setTitle("直线"); // 设置画布的标题
clearScreen(); // 清除画布
gc.drawLine(10,10,w-20,h-20); // 绘制黑色直线
gc.setColor(0,0,255); // 设置绘图颜色为蓝色
gc.drawLine(10,h/2,w-10,h/2); // 绘制蓝色直线
}
// 绘制弧
public void drawArc() {
setTitle("弧线和填充弧");
clearScreen();
gc.drawArc(5,5,w/2-20,h/2-20,60,216); // 绘制弧线
gc.drawArc(5,h/2-10,w/2-20,h/2-20,0,360); // 绘制圆
gc.setColor(0,0,255);
gc.fillArc(w/2,5,w/2-20,h/2-20,60,216); // 绘制填充弧线
gc
- 2023-04-11 05:50:03下载
- 积分:1
-
work
说明: CFAR的matlab仿真 恒虚警算法的仿真 可以使用其进行仿真(Matlab simulation of CFAR CFAR algorithm can be used for simulation)
- 2020-03-08 19:43:46下载
- 积分:1
-
利用灰色系统进行预测的几篇好论文:
BP神经网络_灰色系统联合模型预测软基沉降量 非线性时间序列神经网络预测方法的研究及应用 股票投资价值灰色马尔可夫预测...
利用灰色系统进行预测的几篇好论文:
BP神经网络_灰色系统联合模型预测软基沉降量 非线性时间序列神经网络预测方法的研究及应用 股票投资价值灰色马尔可夫预测 股票投资价值灰色系统模型及应用 灰色关联神经网络模型在股指预测中的应用 灰色理论与模型及在车辆拥有量预测中的应用 灰色神经网络交通事故预测比较 灰色神经网络预测模型的应用 灰色-神经网络综合预测模型-Gray prediction system using a few good papers: BP neural network system _ a joint model gray soft ground settlement prediction of nonlinear time series prediction method of neural network research and application of the gray value of equity investments Markov prediction value of the equity investments of the gray system Application of gray relational model and neural network model in forecasting stock gray theory and model and prediction of vehicle ownership in the application of gray neural network traffic prediction compare gray neural network prediction model of the application of gray- the integrated neural network prediction model
- 2023-04-04 07:10:03下载
- 积分:1
-
IEC61000-4-7-2009
IEC61000-4-7-2009 国际的最新谐波和间谐波的标准(IEC61000-4-7-2009 and the latest international standards for harmonics and inter harmonics)
- 2011-04-19 16:29:25下载
- 积分:1
-
黄永刚晶体塑性模型
说明: 构建晶体塑性模型,晶粒之间的动力学关系,可以预测晶体取向、晶粒形态、织构等(The crystal orientation, grain morphology and texture can be predicted by constructing the crystal plasticity model and the dynamic relationship between grains)
- 2021-04-01 18:59:08下载
- 积分:1
-
Game Boy Advanced (GBA), Nintendo of Japan in 2001 introduced a 32
Game Boy Advanced(GBA)是日本任天堂公司于2001年推出的一款32位掌上游戏机.它着重于游戏机的便携式,并且以2D游戏为主(3D游戏依然不错).GBA有十分高效硬件图像处理加速,GBA基本上是现在全球公认的最佳的掌上游戏机.-Game Boy Advanced (GBA), Nintendo of Japan in 2001 introduced a 32-bit handheld console. It focuses on the portable console, and a 2D game-focused (3D games still good). GBA has a very efficient image processing hardware acceleration is basically GBA now recognized worldwide as the best handheld console.
- 2022-02-22 04:13:33下载
- 积分:1
-
好用的VB屏幕放大镜程序源码
好用的VB屏幕放大镜程序源码,放大镜的作用:屏幕放大,适用于普通各类人士阅读屏幕较小文字或表格。可以放大0.5倍、1倍、2倍、5倍。使用用法:启动程序后,需要放大哪里,就把鼠标移动到哪里,放大镜中显示的就是鼠标所在像素的图像。
- 2022-08-15 19:07:07下载
- 积分:1
-
Beamforming algorithm in MATLAB to achieve under the
波束形成算法在MATLAB下的实现源代码
-Beamforming algorithm in MATLAB to achieve under the
- 2023-01-25 15:05:03下载
- 积分:1
-
Location_Tracking
单传感器对目标的定位跟踪。包括基于CA和IMM模型的EKF和UKF算法。(Single sensor on the target' s location tracking. Including those based on CA and the IMM algorithm model EKF and UKF.)
- 2020-08-11 17:08:27下载
- 积分:1
-
1
多款不同角度旋转的3D按钮风格,可惜的是部分代码采用CSS3实现,IE下效果不近完美,同学们只能在火狐等浏览器下观赏了。(A number of different angles of rotation of the 3D button style, unfortunately, part of the code using CSS3 to achieve, IE effect is not nearly perfect, students can only watch under Firefox and other browsers.)
- 2018-08-24 13:56:20下载
- 积分:1