📄 win32helper.vb
字号:
Imports System.Runtime.InteropServices
Public NotInheritable Class Win32Helper
Public Structure TRIVERTEX
Public x As Integer
Public y As Integer
Public Red As UShort
Public Green As UShort
Public Blue As UShort
Public Alpha As UShort
Public Sub New(ByVal x As Integer, ByVal y As Integer, ByVal color As Color)
Me.New(x, y, color.R, color.G, color.B, color.A)
End Sub
Public Sub New(ByVal x As Integer, ByVal y As Integer, ByVal red As UShort, ByVal green As UShort, ByVal blue As UShort, ByVal alpha As UShort)
Me.x = x
Me.y = y
Me.Red = CUShort((red << 8))
Me.Green = CUShort((green << 8))
Me.Blue = CUShort((blue << 8))
Me.Alpha = CUShort((alpha << 8))
End Sub
End Structure
Public Structure GRADIENT_RECT
Public UpperLeft As UInteger
Public LowerRight As UInteger
Public Sub New(ByVal ul As UInteger, ByVal lr As UInteger)
Me.UpperLeft = ul
Me.LowerRight = lr
End Sub
End Structure
<DllImport("coredll.dll", SetLastError:=True, EntryPoint:="GradientFill")> _
Public Shared Function GradientFill(ByVal hdc As IntPtr, ByVal pVertex As TRIVERTEX(), ByVal dwNumVertex As UInteger, ByVal pMesh As GRADIENT_RECT(), ByVal dwNumMesh As UInteger, ByVal dwMode As UInteger) As Boolean
End Function
Public Const GRADIENT_FILL_RECT_H As Integer = 0
Public Const GRADIENT_FILL_RECT_V As Integer = 1
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -