择花_flower 2014年01月02日
用FrameRgn给PictureBOX绘个边框为什么,什么都看不到???????
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)) '创建涮子

Me.Picture1.FillColor = QBColor(9) '设置填充色

kl = FrameRgn(Picture1.hdc, Picture1.hWnd, hBrush, 20, 20) '绘制一个边框
Print kl '如果FrameRGN绘制成功就返回非0

Me.Picture1.Refresh '涮新
DeleteObject (hBrush) '删除涮子
End Sub




以下是原文件http://pan.baidu.com/s/1mg6YSek


以下是API的解
FrameRgn
编辑
VB声明 Declare 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
说明
用指定刷子 围绕指定区域 画一个外框
返回值 Long,
执行成功返回非零值,
失败为0
参数表
参数 类型及说明
hdc Long,设备场景句柄
hRgn Long,将数据设备坐标填充的区域句柄
hBrush Long,将用的刷子句柄
nWidth Long,垂直边框宽度(以设备单元为单位)
nHeight Long,水平边框高度(以设备单元为单位)
...全文
242 点赞 收藏 3
写回复
3 条回复

还没有回复,快来抢沙发~

发动态
发帖子
API
创建于2007-09-28

1196

社区成员

2.3w+

社区内容

VB API
社区公告
暂无公告