-
Java绘图:绘制虚线与实线
Java绘图:绘制虚线与实线
public LineDemo(){
super("实线与虚线"); //调用父类构造函数
setSize(300,200); //设置窗口尺寸
setVisible(true); //设置窗口可视
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //关闭窗口时退出程序
}
public void paint(Graphics g){ //绘制组件方法
Graphics2D g2=(Graphics2D)g; //得到2D图形
Dimension dim = this.getSize(); //得到组件尺寸
g2.setColor(Color.white); //设置绘制颜色为白色
g2.fillRect(0, 0, dim.width, dim.height); //填充整个组件
g2.setColor(Color.black); //设置绘制颜色
g2.drawLine(40,160,280,160); //绘制实线
g2.drawLine(40,160,40,40);
g2.drawString("0",30,165); //绘制字符串
g2.drawString("100",16,50);
g2.drawString("200",270,175);
float[] dash={5,5}; //短划线图案
BasicStroke bs = new BasicStroke(1,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER, 10.0f,dash,0.0f); //实例化新画刷
g2.setStroke(bs); //设置新的画刷
g2.drawLine(40,160,100,120); //用新的画刷绘制虚线
- 2022-01-28 07:52:17下载
- 积分:1
-
csharp中异步变同步的基础类库,可以用来把大量的异步过程在同步过程中实现,可以参考相关的文章,因为原文章中这段代码都不完整,此处做了整理,把关键的代码补齐了...
csharp中异步变同步的基础类库,可以用来把大量的异步过程在同步过程中实现,可以参考相关的文章,因为原文章中这段代码都不完整,此处做了整理,把关键的代码补齐了-AsyncEnumerator and interlock source
- 2022-06-15 22:56:10下载
- 积分:1
-
球粒子Mie散射(含蒙特卡洛仿真)-Kevin Zhu
说明: 球粒子Mie散射(含蒙特卡洛仿真)-Kevin Zhu(Mie scattering of spherical particles (including Monte Carlo simulation) - Kevin Zhu)
- 2020-07-28 08:18:40下载
- 积分:1
-
SPI_RC522
已经调通的SPI RC522代码,欢迎大家下载参阅(SPI RC522 code that has been switched on)
- 2018-07-28 11:15:02下载
- 积分:1
-
memcard是multiplaform卡片上写一个单词学习Python软件..
memcard is a multiplaform flashcard word learning software written on a python language.
(tested on RHEL5 and MS Vista)
- 2022-08-20 21:05:11下载
- 积分:1
-
Untitled2
说明: 在混合高斯背景模型中,认为像素之间的颜色信息互不相关,对各像素点的处理都是相互独立的。对于视频图像中的每一个像素点,其值在序列图像中的变化可看作是不断产生像素值的随机过程,即用高斯分布来描述每个像素点的颜色呈现规律单模态(单峰),多模态(多峰)(Gaussian mixture background modeling is a background representation method based on the statistical information of pixel samples. Statistical information such as the number of patterns, the mean and standard deviation of each pattern are used to represent the background. Statistical difference (such as 3_principle) is used to judge the target pixel. Complex dynamic background modeling has a large amount of computation. In the Gaussian mixture background model, it is considered that the color information between pixels is uncorrelated and the processing of each pixel is independent of each other. For each pixel in a video image, the change of its value in a sequential image can be seen as a random process that produces pixel values continuously, i.e. Gaussian distribution is used to describe the regularity of color rendering of each pixel in single mode (single peak) and multi-mode (multi-peak))
- 2020-06-20 04:20:02下载
- 积分:1
-
sanxiangnibian_igbt
说明: 此模型采用六个IGBT搭建成逆变桥,通过六个脉冲发生器产生六路脉冲,控制igbt的状态,产生三项交流。(In this model, six IGBTs are used to build the inverter bridge, and six pulses are generated by six pulse generators to control the state of IGBT and generate three AC.)
- 2020-04-16 21:56:20下载
- 积分:1
-
IP核!!高速傅立叶变换的VHDL源代码 可以综合
IP核!!高速傅立叶变换的VHDL源代码 可以综合-IP core! ! High-speed Fourier transform of the VHDL source code can be integrated!!
- 2022-03-02 20:49:37下载
- 积分:1
-
OpenSees2.2.1
OpenSees2.2.1源代码,有限元开源软件(OpenSees2.2.1 source code)
- 2018-05-06 13:35:16下载
- 积分:1
-
mbzg
websevice pb6.5调使用事例多参数修改传送,接收返回处理(Websevice tuning example)
- 2017-09-14 19:09:26下载
- 积分:1