This problem I baidu for a long time, also didn't find the function, and the specific usage of function,
I try to declare the reference circle function such painting fan function
Draw round Function: Public Declare Function GdipDrawEllipseI Lib "gdiplus" (ByVal Graphics As Long, ByVal pen As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) As GpStatus
Didn't check the Function of the fan, I try to gather together a: Public Declare Function GdipDrawPie Lib "gdiplus" (ByVal Graphics As Long, ByVal pen As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal X3 As Long, ByVal Y3 As Long) As GpStatus didn't complain, however, only to draw a circle,
Helpless pain ah, what a player can be solved? My email is [email protected] QQ 1002031672
CodePudding user response:
Don't need a GDI +, is directly with GDI, fan, in fact, is the API, painting circle, add parameters, can draw fan, translucent, can be achieved in other waysCodePudding user response:
Public Sub circle (hDc As Long, ByVal circle X As Long, ByVal circle Y As Long, ByVal width As Long, ByVal height As Long, _ByVal degree starting point As Long, ByVal degree of finish As Long, ByVal box line thickness As Long, ByVal line type As the line type _m, ByVal border color As Long, ByVal fill color As Long)
Dim pBrush As Long, pPen As Long
Dim X1 As Long, X2 As Long, X3 As Long, x4 As Long
Dim Y1 As Long, Y2 As Long, Y3 As Long, y4 As Long
Dim As A Single
X1=center X - width/2
X2=center X + width/2
Y1=circle Y - height/2
Y2=circle Y + height/2
A=3.14159265/180 'for converting Angle radian
X3=center X + (width * Sin (degree starting point * A))
Y3=circle Y - (level * Cos (degree starting point * A))
X4=center X + (width * Sin (degree of finish * A))
Y4=circle Y - (level * Cos (degree of finish * A))
PBrush=SelectObject (hDc, CreateSolidBrush (fill color))
PPen=SelectObject (hDc, CreatePen (line type, line thickness, border color))
If fill color & lt; 0 Then
Call the Arc (hDc, X1, Y1, X2, Y2, X3, Y3, x4, y4)
The Else
Call Pie (hDc, X1, Y1, X2, Y2, X3, Y3, x4, y4)
End the If
Call DeleteObject (SelectObject (hDc, pBrush))
Call DeleteObject (SelectObject (hDc, pPen))
End Sub
CodePudding user response:
Translucent, fan painting first, P2, and then use thePublic Function translucent copy figure 2 (ByVal target DC As Long, ByVal target x As Long, ByVal y target As Long, ByVal w target As Long, ByVal h target As Long, ByVal source DC As Long, ByVal source x As Long, ByVal y source As Long, ByVal w source As Long, ByVal h source As Long, ByVal transparency percentage As Long) As Long
Dim lngBlend As Long
'lngBlend=Val (" & amp; H "& amp; Hex (transparent) & amp; "00" & amp; "00")
LngBlend=RGB (0, 0, 255-2.55 * transparency percentage)
AlphaBlending target DC, target x, y, w, h, DC source, source of x, y source, source of w, h, lngBlend
End the Function
P1 P2 translucent is copied to the display is ok, Picture1 is displayed, hidden Picture2
CodePudding user response:
The research, done,Survived the images, modify the suffix for ZIP can see project file decompression,
CodePudding user response: