Home > Software engineering >  GDI genuflect is begged in VB6.0 by use of the function and the use of the environment to draw fan m
GDI genuflect is begged in VB6.0 by use of the function and the use of the environment to draw fan m

Time:10-31

GDI + genuflect is begged in VB6.0 by use of the function and the use of the environment to draw fan method

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 ways

CodePudding 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 the
Public 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:

reference 1st floor yfvb2010 response:
don't need a GDI +, is directly with GDI, fan, in fact, is the API, painting circle, add parameters, can draw fan, translucent, use other ways to achieve

I advise this guy who involved with alpha channel semitransparent graphics or abandon the GDI as soon as possible, use GDI +...

CodePudding user response:

Me4405801 upstairs is superior, after testing, basic is what I want, thank you very much, keep in touch!

CodePudding user response:

Thank you again for the upstairs, I carefully read your application, your fan statement function

Public Declare Function GdipDrawPieI 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, ByVal startAngle As Single, ByVal sweepAngle As Single) As GpStatus
My own blind together fan statement function

'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

Problem is in the parameter names and types are right,


In order to avoid the blind my cat touch dead mouse tinkering,
Pal, can you send me a detailed under the VB6.0 by use of GDI + all sorts of function declaration list, attach the use of specific methods, best , like datasheet, it would be grateful!

CodePudding user response:

refer to 7th floor u011568473 response:
thank you again for the upstairs, I carefully read your application, your fan statement function

Public Declare Function GdipDrawPieI 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, ByVal startAngle As Single, ByVal sweepAngle As Single) As GpStatus
My own blind together fan statement function

'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

Problem is in the parameter names and types are right,


In order to avoid the blind my cat touch dead mouse tinkering,
Pal, can you send me a detailed under the VB6.0 by use of GDI + all sorts of function declaration list, attach the use of specific methods, best , like datasheet, it would be grateful!


You let me say you what good...
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • API
  • Related