- DimgAsGraphics=Me.CreateGraphics
- DimmybrushAsNewDrawing2D.LinearGradientBrush(ClientRectangle,Color.Blue,Color.Yellow,Drawing2D.LinearGradientMode.Horizontal)
- DimmyfontAsNewFont("timesnewroman",40)
- '由于提供了RECTANGLEf对象,所以文本将在矩形中换行
- g.DrawString("Hello,world!keenweiwei!",myfont,mybrush,NewPoint(10,10))
由蓝色向黄色渐变
-------------------------------------------------------
不加任何控件展现图像
- DimmybitmapAsNewBitmap("d:/我的文档/桌面/002.jpg")
- DimgAsGraphics=Me.CreateGraphics
- '必须同时指定要绘制的图像以及绘制它的坐标位置
- g.DrawImage(mybitmap,20,20)
用图片来填充一个椭圆区域
- PrivateSubButton7_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton7.Click
- 'DimmybrushAsNewSolidBrush(Color.Yellow)
- DimmybrushAsNewTextureBrush(NewBitmap("d:/我的文档/桌面/002.jpg"))
- DimgAsGraphics=Me.CreateGraphics
- g.FillEllipse(mybrush,ClientRectangle)
- EndSub