1 / 6

实验十二 画图

实验十二 画图. 一、实验目的 1 、掌握各种绘制图形的方法: Pset 、 Line 、 Circle 、 PaintPicture 的使用; 2 、掌握各种与绘图有关的属性、方法、事件; 3 、掌握鼠标事件与键盘事件的应用。 二、实验内容 1 、用 Pset 方法绘图. 下一页. 【 实验要求 】. 在窗体上随机画一条不同亮度的红色彩带,然后再清除,在其他位置再又画一条不同亮度的红色彩带,形成彩带在垂直方向浮动的动态效果。 9_zy1.vbp. 上一页. 下一页. 2 、用 Line 方法画矩形.

zlhna
Download Presentation

实验十二 画图

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 实验十二 画图 一、实验目的 1、掌握各种绘制图形的方法:Pset、Line、Circle、PaintPicture 的使用; 2、掌握各种与绘图有关的属性、方法、事件; 3、掌握鼠标事件与键盘事件的应用。 二、实验内容 1、用 Pset 方法绘图 下一页

  2. 【实验要求】 • 在窗体上随机画一条不同亮度的红色彩带,然后再清除,在其他位置再又画一条不同亮度的红色彩带,形成彩带在垂直方向浮动的动态效果。 9_zy1.vbp 上一页 下一页

  3. 2、用 Line 方法画矩形 【实验要求】用 Line 方法在窗体上画若干个同心并填充不同颜色的矩形。运行结果如图所示:9_zy2.vbp 上一页 下一页

  4. 3、用 Cicle 方法绘图 9_zy3.vbp 【实验要求】设置一个模拟行星绕太阳运动的程序。 • 提示:行星运动的椭圆方程为: x=x0+rx*cos(alfa) y=y0+ry*sin(alfa) • 其中:x0、y0为椭圆圆心坐标;rx为水平半径,ry为垂直半径;alfa为圆心角。 • 用 Shape 控件绘制 两个圆(红色代表太阳, 蓝色代表行星) 上一页 下一页

  5. 4、用 Circle 方法画圆 9_zy4.vbp • 编程序在窗体的中央绘制一半径随机、色彩随机的同心圆。如图: 上一页 下一页 返回首页

  6. 5、用 Line 方法画线 9_zy5.vbp • 用 Line 方法在窗体上绘制艺术图案,程序构造图案的算法为:把一个半径为r 的圆周等分为 n 份,然后用直线将这些点两两相连,如图: 上一页

More Related