如何在VB,不是VB.net中使用GDI?

树莓派 2003-01-28 06:07:05
我想给我的窗体加背景图片,在.net中,可以将一幅图片平铺在窗体上面,这个怎样在VB6中实现啊。
...全文
29 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
holydiablo 2003-01-29
  • 打赏
  • 举报
回复

没什么比API更实在的了
litsnake1 2003-01-29
  • 打赏
  • 举报
回复
同意
thirdapple 2003-01-29
  • 打赏
  • 举报
回复
怎么会呢?不清楚,看看是不是动态加载的控件的问题
树莓派 2003-01-29
  • 打赏
  • 举报
回复
但是这样的话,我以后动态加载的控件就无法显示了,这个问题怎样解决呢?
thirdapple 2003-01-28
  • 打赏
  • 举报
回复
Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

Public Function FillBlt(frm As Object, Pic As Object)
Dim i As Long, j As Long
frm.ScaleMode = 3
frm.AutoRedraw = True
Pic.AutoRedraw = True
Pic.ScaleMode = 3
Pic.AutoSize = True
For i = 0 To frm.ScaleWidth Step Pic.ScaleWidth
For j = 0 To frm.ScaleHeight Step Pic.ScaleHeight
BitBlt frm.hdc, i, j, Pic.ScaleWidth, Pic.ScaleHeight, Pic.hdc, 0, 0, vbSrcCopy
Next j
Next i
frm.Refresh
End Function
programart_life 2003-01-28
  • 打赏
  • 举报
回复
用代码实现。API函数

BitBlt、StretchBlt等等等等,很多这样的函数。

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧