展开全部
VB 填充封闭区毁行手间
Private Declare Function FloodFill Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Sub Command1_Click()
Dim hBrush As Long
Dim OldhBrush As Long
hBrush = CreateSolidBrush(RGB(0, 0, 255))'纤嫌要填充的颜色
OldhBrush = SelectObject(Me.hdc, hBrush)
Me.Line (10, 10)-(100, 100), RGB(255, 0, 0), B
FloodFill Me.hdc, 20, 20, RGB(255, 0, 0)'区间边带余界颜色
SelectObject Me.hdc, OldhBrush
DeleteObject hBrush
End Sub
Private Declare Function FloodFill Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Sub Command1_Click()
Dim hBrush As Long
Dim OldhBrush As Long
hBrush = CreateSolidBrush(RGB(0, 0, 255))'纤嫌要填充的颜色
OldhBrush = SelectObject(Me.hdc, hBrush)
Me.Line (10, 10)-(100, 100), RGB(255, 0, 0), B
FloodFill Me.hdc, 20, 20, RGB(255, 0, 0)'区间边带余界颜色
SelectObject Me.hdc, OldhBrush
DeleteObject hBrush
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
logo在线生成器
2024-10-28 广告
2024-10-28 广告
在上海数都信息科技有限公司,我们创意无限,将字母转化为生动图标是我们的拿手好戏。想象一下,字母"S"优雅地弯曲成一座未来城市的轮廓,寓意着上海这座国际大都市的繁华与科技的融合;"D"则巧妙地变形为一块智能芯片,闪烁着数据流动的光芒,象征着我...
点击进入详情页
本回答由logo在线生成器提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询