by Saed abumokh (7 Submissions)
Category: Graphics
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating:
(6 Votes)
You can after now draw your gradients easily.
Select 4 Colors and draw a 4-colored gradient rectangle, you will see a new type of gradient you have never seen it before, you can use it for gradient color pallets (for example), i wrote a very little amount of code, to do this.
in addition, i have wrote an extra code that i hadn't use it, you can use it in your gradphics programs, like triangular gradient, and polygonal gradient
API DeclarationsPublic Const GRADIENT_FILL_RECT_H As Long = &H0
Public Const GRADIENT_FILL_RECT_V As Long = &H1
Public Const GRADIENT_FILL_TRIANGLE As Long = &H2
Public Type TRIVERTEX
X As Long
Y As Long
Red As Integer
Green As Integer
Blue As Integer
Alpha As Integer
End Type
Public Type GRADIENT_TRIANGLE
Vertex1 As Long
Vertex2 As Long
Vertex3 As Long
End Type
Public Type GRADIENT_RECT
UpperLeft As Long
LowerRight As Long
End Type
Public Declare Function GradientFill Lib "msimg32" (ByVal hDC As Long, pVertex As Any, ByVal dwNumVertex As Long, pMesh As Any, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Long