第11章节图形与图像.pptVIP

  • 3
  • 0
  • 约1.02万字
  • 约 24页
  • 2017-04-01 发布于四川
  • 举报
第11章节图形与图像

第11章 图形和图像 §11.1 绘制图形 一、图形控件 一、图形控件 二、图形的坐标系统 二、图形的坐标系统 二、图形的坐标系统 三、与图形有关的属性 四、使用颜色 五、绘图方法 五、绘图方法 五、绘图方法 五、绘图方法 六、绘图语句与Paint事件 §11.2  显示图片 一、直接加载图片到窗体 二、使用图像控件 三、使用图片框控件 案例程序举例 案例程序9:用程序绘制美丽的花 案例程序9:用程序绘制美丽的花 Private Sub Form_Load() Form1.WindowState = 2 P1.AutoSize = True P1.Picture = LoadPicture(art04.jpg) P2.Left = P1.Width End Sub Private Sub Command1_Click() 截取图象 P2.PaintPicture P1.Picture, 0, 0, P2.Width, P2.Height, P1.Width / 4, P1.Height / 4, P1.Width / 2, P1.Height / 2 P2.PaintPicture P1.Picture, 0, 0, , , P1.Width / 4, P1.Height / 4, P1.Width / 2, P1.Height / 2 End Sub Private Sub Command2_Click() 垂直翻转 P2.PaintPicture P1.Picture, 0, 0, P2.Width, P2.Height, 0, P1.Height, P1.Width, -P1.Height End Sub Private Sub Command3_Click() 水平翻转 P2.PaintPicture P1.Picture, 0, 0, P2.Width, P2.Height, P1.Width, 0, -P1.Width, P1.Height End Sub Private Sub Command4_Click() 两者翻转 P2.PaintPicture P1.Picture, 0, 0, P2.Width, P2.Height, P1.Width, P1.Height, -P1.Width, -P1.Height End Sub Private Sub HScroll1_Change() Label1.Caption = HScroll1.Value Label1.BackColor = RGB(HScroll1.Value, 0, 0) End Sub Private Sub HScroll1_Scroll() Label2.Caption = HScroll1.Value Label2.BackColor = RGB(HScroll1.Value, 0, 0) End Sub Dim x As Integer, y As Integer Dim t As Single, xt As Single, yt As Single Private Sub Form_Resize() ScaleMode = 6 x = Me.ScaleWidth / 2 y = Me.ScaleHeight / 2 Me.BackColor = vbBlack End Sub Private Sub Timer1_Timer() t = t + 0.1 xt = Cos(t) + t * Sin(t) yt = -Sin(t) + t * Cos(t) PSet (xt + x, yt + y), vbYellow End Sub *   VB除了具有方便的控件、美观的图形用户界面之外,还支持绘图功能。VB中既可以使用形状控件、直线控件制作规则图形 ,又可以使用内建的绘图方法绘制图形 ,还可以使用窗体、图片框、图像框有关控件来处理各种格式的图形文件。 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspose Pty Ltd. 一、图形控件 二、图形的坐标系统 三、与图形有关的属性 四、使用颜色 五、绘图方法 六、绘图语句与Paint事件 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspo

文档评论(0)

1亿VIP精品文档

相关文档