GDI
来源:互联网 发布:基金有什么软件 编辑:程序博客网 时间:2024/06/16 10:47
'绘制空心图形
Private Sub DrawEllipse() '绘制椭圆 Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red) Dim formGraphics As System.Drawing.Graphics formGraphics = Me.CreateGraphics() formGraphics.DrawEllipse(myPen, New Rectangle(0, 0, 200, 300)) myPen.Dispose() formGraphics.Dispose()End SubPrivate Sub DrawRectangle() '绘制矩形 Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red) Dim formGraphics As System.Drawing.Graphics formGraphics = Me.CreateGraphics() formGraphics.DrawRectangle(myPen, New Rectangle(0, 0, 200, 300)) myPen.Dispose() formGraphics.Dispose()End SuB
Public Sub DrawString() '绘制文本 Dim formGraphics As System.Drawing.Graphics = Me.CreateGraphics() Dim drawString As String = "Sample Text" Dim drawFont As New System.Drawing.Font("Arial", 16) Dim drawBrush As New _ System.Drawing.SolidBrush(System.Drawing.Color.Black) Dim x As Single = 150.0 Dim y As Single = 50.0 Dim drawFormat As New System.Drawing.StringFormat formGraphics.DrawString(drawString, drawFont, drawBrush, _ x, y, drawFormat) drawFont.Dispose() drawBrush.Dispose() formGraphics.Dispose()End Sub
Private Sub RenderText6(ByVal e As PaintEventArgs) '绘制多行文本 Dim flags As TextFormatFlags = TextFormatFlags.Bottom Or _ TextFormatFlags.EndEllipsis TextRenderer.DrawText(e.Graphics, _ "This is some text that will be clipped at the end.", _ Me.Font, New Rectangle(10, 10, 100, 50), SystemColors.ControlText, flags)End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As _ System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint ' Draw a circle with a bar on top.
'在 Windows 窗体中复制像素以减少闪烁 e.Graphics.FillEllipse(Brushes.DarkBlue, New Rectangle _ (10, 10, 60, 60)) e.Graphics.FillRectangle(Brushes.Khaki, New Rectangle _ (20, 30, 60, 10)) ' Copy the graphic to a new location. e.Graphics.CopyFromScreen(New Point(10, 10), New Point _ (100, 100), New Size(70, 70))End Sub
Dim myBrush As New System.Drawing.SolidBrush(System.Drawing.Color.Red)Dim formGraphics As System.Drawing.GraphicsformGraphics = Me.CreateGraphics()formGraphics.FillEllipse(myBrush, New Rectangle(0, 0, 200, 300))myBrush.Dispose()formGraphics.Dispose()
’创建特定形状的 Windows 窗体
Protected Overrides Sub OnPaint( _ByVal e As System.Windows.Forms.PaintEventArgs) Dim shape As New System.Drawing.Drawing2D.GraphicsPath shape.AddEllipse(0, 0, Me.Width, Me.Height) Me.Region = New System.Drawing.Region(shape) End Sub
0 0
- GDI+
- GDI+
- GDI+
- GDI
- GDI
- GDI+
- GDI+
- GDI+
- gdi+
- GDI+
- GDI+
- GDI+
- GDI+
- GDI+
- GDI
- GDI+
- GDI
- GDI
- 1- mongoDB安装及基础
- 如何记忆Android模拟器中的快捷键
- 人生就是一个大项目
- Leetcode#13:romanToInt 暑假训练第一弹
- APIO2009 抢掠计划
- GDI
- How Can I Create Histogram Projection In Opencv ?
- 学习如何从源代码分析Android Sdk--LinearLayout
- programming-challenges WERTYU (110301) 题解
- grails gsp 无法热部署(2.4)
- 正则表达式如何验证邮箱
- 如何用C设计和实现抽象数据类型(封装)
- 内存共享(Shared Memory)
- 史上最全最强SpringMVC详细示例实战教程