About .net GDI+ for testing:
Private Sub Form6_Paint(ByVal sender As Object,ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim pen As New System.Drawing.Pen(Color.FromArgb(100,255),25)
'Dim graphics As System.Drawing.Graphics = e.Graphics
'graphics.DrawLine(pen,20,10,50,10)
'Dim graphics1 As System.Drawing.Graphics = e.Graphics
'graphics1.DrawRectangle(pen,20)
'Dim graphics2 As System.Drawing.Graphics = System.Drawing.Graphics.FromHwnd(Me.Handle)
'graphics2.DrawRectangle(pen,70,70)
'Dim graphics3 As System.Drawing.Graphics = e.Graphics
'graphics3.DrawEllipse(pen,80,100)
'Dim graphics4 As System.Drawing.Graphics = e.Graphics
'graphics4.DrawPie(pen,101,90)
'Dim graphics5 As System.Drawing.Graphics = e.Graphics
'graphics5.DrawArc(pen,150,140,30,357)
'Dim graphics6 As System.Drawing.Graphics = e.Graphics
'Dim pointarray As Point() = {New Point(0,0),New Point(10,30),New Point(30,30)}
'graphics6.DrawPolygon(pen,pointarray)
'graphics6.DrawCurve(pen,pointarray,1.5F)
'graphics6.DrawBezier(pen,40,100,10)
'Dim graphics7 As System.Drawing.Graphics = e.Graphics
'Dim graphicspath As New System.Drawing.Drawing2D.GraphicsPath
'Dim pointarray1 As Point() = {New Point(5,New Point(20,40),New Point(50,30)}
'Dim fontfamily As New System.Drawing.FontFamily("宋体")
'Dim pointf As New System.Drawing.PointF(50,20)
'Dim stringformat As New System.Drawing.StringFormat
'graphicspath.AddArc(0,-90,180)
'graphicspath.StartFigure()
'graphicspath.AddCurve(pointarray1)
'graphicspath.AddString("字符串",fontfamily,24,pointf,stringformat)
'graphicspath.AddPie(230,110)
'graphics7.DrawPath(pen,graphicspath)
'Dim graphics8 As System.Drawing.Graphics = e.Graphics
'Dim solidbrush As New System.Drawing.SolidBrush(Color.Red)
'graphics8.FillEllipse(solidbrush,60,40)
'Dim hatchbrush As New System.Drawing.Drawing2D.HatchBrush(Drawing2D.HatchStyle.DottedGrid,Color.Blue,Color.Green)
'graphics8.FillEllipse(hatchbrush,40)
'Dim image As System.Drawing.Image = System.Drawing.Image.FromFile("d:/untitleddf.bmp")
'Dim texturebrush As New System.Drawing.TextureBrush(image)
'graphics8.FillEllipse(texturebrush,50)
'' Set the Clip property to a new region.
'e.Graphics.Clip = New Region(New Rectangle(10,200))
'' Fill the region.
'e.Graphics.FillRegion(Brushes.LightSalmon,e.Graphics.Clip)
'' Demonstrate the clip region by drawing a string
'' at the outer edge of the region.
'e.Graphics.DrawString("Outside of Clip",New Font("Arial",12.0F,FontStyle.Regular),_
' Brushes.Black,0.0F,0.0F)
'Dim bitmap As System.Drawing.Bitmap = System.Drawing.Image.FromFile("d:/untitleddf.bmp")
'e.Graphics.DrawImage(bitmap,0)
'Dim bitmap As New System.Drawing.Bitmap("untitleddf.bmp")
'Dim rect As New System.Drawing.Rectangle(250,250,bitmap.Width / 4,bitmap.Height / 4)
'Dim nbitmap As System.Drawing.Bitmap = bitmap.Clone(rect,Imaging.PixelFormat.DontCare)
'e.Graphics.DrawImage(bitmap,10)
'e.Graphics.DrawImage(nbitmap,10)
'Dim bitmap As New System.Drawing.Bitmap("untitleddf.bmp")
'Dim expansionrectangle As New System.Drawing.Rectangle(135,bitmap.Width,bitmap.Height)
'Dim compressionrectangle As New System.Drawing.Rectangle(300,bitmap.Width / 2,bitmap.Height / 2)
'e.Graphics.DrawImage(bitmap,10)
'e.Graphics.DrawImage(bitmap,expansionrectangle)
'e.Graphics.DrawImage(bitmap,compressionrectangle)
'Dim bitmap As New System.Drawing.Bitmap("untitleddf.bmp")
'Dim sourcerectangle As New System.Drawing.Rectangle(150,480,120)
'Dim destrectangle1 As New System.Drawing.Rectangle(0,400,400)
'Dim destrectangle2 As New System.Drawing.Rectangle(200,200,160)
'e.Graphics.DrawImage(bitmap,0)
'e.Graphics.DrawImage(bitmap,destrectangle1,sourcerectangle,GraphicsUnit.Pixel)
'e.Graphics.DrawImage(bitmap,destrectangle2,GraphicsUnit.Pixel)
'e.Graphics.TranslateTransform(100,50)
'e.Graphics.DrawLine(pen,160,80)
'Dim matrix As New System.Drawing.Drawing2D.Matrix
'matrix.Rotate(30)
'matrix.Scale(1,2,Drawing2D.MatrixOrder.Append)
'matrix.Translate(5,Drawing2D.MatrixOrder.Append)
'e.Graphics.DrawEllipse(pen,50)
'e.Graphics.ScaleTransform(1,0.5F)
'e.Graphics.TranslateTransform(50,Drawing2D.MatrixOrder.Append)
'e.Graphics.RotateTransform(30,Drawing2D.MatrixOrder.Append)
'e.Graphics.DrawEllipse(pen,50)
'e.Graphics.DrawLine(pen,100)
'Dim bitmap As New System.Drawing.Bitmap("untitleddf.bmp")
'e.Graphics.DrawLine(New System.Drawing.Pen(Color.FromArgb(255,25),New System.Drawing.Point(10,35),New System.Drawing.Point(200,35))
'e.Graphics.DrawImage(bitmap,New System.Drawing.Rectangle(30,bitmap.Width / 12,bitmap.Height / 12))
'Dim bitmap As New System.Drawing.Bitmap("untitleddf.bmp")
'Dim matrixsingle As System.Single()() = { _
' New Single() {1,0},_
' New Single() {0,1,0.7F,1}}
'Dim colormatrix As New System.Drawing.Imaging.ColorMatrix(matrixsingle)
'Dim imageattribute As New System.Drawing.Imaging.ImageAttributes
'imageattribute.SetColorMatrix(colormatrix,Imaging.ColorMatrixFlag.Default,Imaging.ColorAdjustType.Bitmap)
'e.Graphics.DrawLine(New System.Drawing.Pen(Color.Black,New Point(200,35))
'Dim nwidth As Integer = bitmap.Width
'Dim nheight As Integer = bitmap.Height
'Dim iwidth As Integer = nwidth * 20
'Dim iheight As Integer = nheight * 20
'e.Graphics.DrawImage(bitmap,New Rectangle(30,nwidth,nheight),iwidth,iheight,GraphicsUnit.Pixel,imageattribute)
'Dim lineargradientbrush As New System.Drawing.Drawing2D.LinearGradientBrush(New Point(0,10),Color.FromArgb(255,255,255))
'Dim pen1 As New System.Drawing.Pen(lineargradientbrush)
'e.Graphics.DrawLine(pen1,10)
'e.Graphics.FillEllipse(lineargradientbrush,100)
'e.Graphics.FillRectangle(lineargradientbrush,155,500,30)
'Dim lineargradientbrush As New System.Drawing.Drawing2D.LinearGradientBrush(New Point(0,255))
'Dim relativeintensites As System.Single() = {0.0F,0.5F,1.0F}
'Dim relativepositions As System.Single() = {0.0F,0.2F,1.0F}
'Dim blend As New System.Drawing.Drawing2D.Blend
'blend.Factors = relativeintensites
'blend.Positions = relativepositions
'lineargradientbrush.Blend = blend
'e.Graphics.FillEllipse(lineargradientbrush,100),0))
'Dim pen2 As New System.Drawing.Pen(lineargradientbrush,10)
'e.Graphics.DrawLine(pen2,600,300)
'e.Graphics.FillEllipse(lineargradientbrush,100)
'Dim path As New System.Drawing.Drawing2D.GraphicsPath
'path.AddEllipse(0,70)
'Dim pathgradientbrush As New System.Drawing.Drawing2D.PathGradientBrush(path)
'pathgradientbrush.CenterColor = Color.FromArgb(255,255)
'Dim colors As System.Drawing.Color() = {Color.FromArgb(255,255)}
'pathgradientbrush.SurroundColors = colors
'e.Graphics.FillEllipse(pathgradientbrush,70)
''e.Graphics.FillEllipse(pathgradientbrush,40)
'Dim points As System.Drawing.Point() = { _
' New Point(75,_
' New Point(100,50),_
' New Point(150,_
' New Point(112,75),150),_
' New Point(75,_
' New Point(0,_
' New Point(37,_
' New Point(50,50) _
' }
'Dim path As New System.Drawing.Drawing2D.GraphicsPath
'path.AddLines(points)
'Dim pathgradientbrush As New System.Drawing.Drawing2D.PathGradientBrush(path)
'pathgradientbrush.CenterColor = Color.FromArgb(255,0)
'Dim colors As System.Drawing.Color() = { _
' Color.FromArgb(255,_
' Color.FromArgb(255,0) _
' }
'pathgradientbrush.SurroundColors = colors
'e.Graphics.FillPath(pathgradientbrush,path)
Dim pointf As System.Drawing.PointF() = { _
New PointF(0,_
New PointF(160,200),_
New PointF(80,_
New PointF(0,200) _
}
Dim pathgradientbrush As New System.Drawing.Drawing2D.PathGradientBrush(pointf)
Dim colors As System.Drawing.Color() = { _
Color.FromArgb(255,_
Color.FromArgb(255,0) _
}
pathgradientbrush.SurroundColors = colors
pathgradientbrush.CenterColor = Color.White
e.Graphics.FillRectangle(pathgradientbrush,New System.Drawing.Rectangle(0,200))
'Dim path As New System.Drawing.Drawing2D.GraphicsPath 'path.AddEllipse(0,230,70) 'Dim pathGBrush As New System.Drawing.Drawing2D.PathGradientBrush(path) 'pathGBrush.CenterPoint = New System.Drawing.PointF(120,40) 'pathGBrush.CenterColor = Color.FromArgb(255,255) 'Dim colors As System.Drawing.Color() = {Color.FromArgb(255,255)} 'pathGBrush.SurroundColors = colors 'e.Graphics.FillEllipse(pathGBrush,70) End Sub
原文链接:https://www.f2er.com/vb/262248.html