Home > Software engineering >  Why use FrameRgn give PictureBOX draw a border, what all can't see???????????
Why use FrameRgn give PictureBOX draw a border, what all can't see???????????

Time:10-15

Private Declare Function FrameRgn Lib "gdi32" (ByVal HDC As Long, ByVal hRgn As Long, ByVal hBrush As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long

Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function PaintRgn Lib "gdi32" (ByVal HDC As Long, ByVal hRgn As Long) As Long



Private Sub Form_Load ()
Dim kl As Long
HBrush=CreateSolidBrush (QBColor (0)) 'create rinse child

Me. Picture1. FillColor=QBColor (9) 'set the fill color

Kl=FrameRgn (Picture1. HDC, Picture1. The hWnd, hBrush, 20, 20) 'draw a border
Print kl 'returns non-zero if FrameRGN drawing successful

Me. Picture1. Refresh 'rinse new
DeleteObject (hBrush) 'remove rinse child
End Sub




The following is the original file
http://pan.baidu.com/s/1mg6YSek

Here are the API solution
FrameRgn
Edit
VB statement to Declare the Function FrameRgn Lib "gdi32" Alias "FrameRgn
"(ByVal HDC As Long, ByVal hRgn As Long, ByVal hBrush As Long
, ByVal nWidth As Long, ByVal nHeight As Long As Long)
Description
With the specified brush draw a frame around the designated area
The return value Long,
Returns a non-zero value on success,
Failure to 0
Parameter list
The parameter types and description
HDC Long, equipment scene handle
HRgn Long, the data device coordinates of area filling handle
HBrush Long, will use the brush handle
NWidth Long, vertical border width (in unit)
NHeight Long, horizontal border height (in unit)

CodePudding user response:

Then I changed to this or not
Dim kl As Long
HBrush=CreateSolidBrush (QBColor (0)) 'create rinse child

Me. Picture1. FillColor=QBColor (9) 'set the fill color

Kl=FrameRgn (Picture1. HDC, Picture1. The hWnd, hBrush, 20, 20) 'draw a border
Print kl 'returns non-zero if FrameRGN drawing successful
SetWindowRgn Picture1. HDC, kl, True '# # # # # # # # # # # # # # # # # # # # # # # # # # # #
Me. Picture1. Refresh 'rinse new
DeleteObject (hBrush) 'remove rinse

CodePudding user response:

FrameRgn second parameter assignment errors

CodePudding user response:

Help, how to set
  •  Tags:  
  • API
  • Related