想在一个FORM里画一个PICTRUEBOX控件,然后把被PICTRUEBOX遮住的FORM上的图像截出来再贴到PICTRUEBOX上,需要说明的是FORM上是没有贴位图的,我说的被遮住的图像是指FORM及其上的一些控件显示的出来的内容,(不知道我这样说得清楚不,汗!!!)。贴图我想用PICTRUEBOX的Paintpicture应该可以做,但我不知道怎么能获得被遮住部分的截图,在此诚心求教!
解决方案 »
- 关于LOAD
- mshflexgride 单元格合并
- 当鼠标停时,如何让在其旁边显示一些数据,比如当前坐标等??
- 这个语句我要写吗
- 怎样把一个VB6.0中的结果集,绑定到Excel中?
- 帮忙解决一下好吗?
- 用VB6编了一个程序,其中用到Data控件来打开Access2000数据库,调试地时候是好的,可以一编译成EXE就报:未找到可插入地ISAM,?
- 请教个问题
- 如何在VB中读取目录下的文件名,扩展名,文件大小,建立日期等信息(要求三级目录)
- 怎样改变自己的IP
- 紧急高分求教高手!!!!!!!快进哦!!!!!!剩下的分都给了
- 我想用rst_btophr1.move 3移动到第三条记录上,可总是移到别的记录行。用rst_btophr1.MoveFirst也不能移到第一行。是怎么回事?见代码:
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type
Private Type PicBmp
SIZE As Long
Type As Long
hBmp As Long
hPal As Long
Reserved As Long
End Type'API函数声明
Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hDC As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hhdc As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hDC As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Longprivate mhBmp As LongPrivate Function hDCToPicture(ByVal hDCSrc As Long, ByVal LeftSrc As Long, ByVal TopSrc As Long, ByVal WidthSrc As Long, ByVal HeightSrc As Long) As Picture
'要确保参数LeftSrc、TopSrc、WidthSrc、HeightSrc的单位为像素!!
Dim hDCMemory As Long
Dim hPal As Long
Dim Pic As PicBmp
Dim IPic As IPicture
Dim IID_IDispatch As GUID
hDCMemory = CreateCompatibleDC(hDCSrc)
If mhBmp <> 0 Then DeleteObject mhBmp mhBmp = CreateCompatibleBitmap(hDCSrc, WidthSrc, HeightSrc)
DeleteObject SelectObject(hDCMemory, mhBmp) 'Copy the source image to our compatible device context
StretchBlt hDCMemory, 0, 0, WidthSrc, HeightSrc, hDCSrc, LeftSrc, TopSrc,
WidthSrc, HeightSrc, vbSrcCopy With IID_IDispatch
.Data1 = &H20400
.Data4(0) = &HC0
.Data4(7) = &H46
End With 'Fill picture info
With Pic
.SIZE = Len(Pic) ' Length of structure
.Type = vbPicTypeBitmap ' Type of Picture (bitmap)
.hBmp = mhBmp ' Handle to bitmap
.hPal = 0
End With 'Create the picture
OleCreatePictureIndirect Pic, IID_IDispatch, 1, IPic DeleteDC hDCMemory
Set hDCToPicture = IPic
End Function
但是老是把自己的边框给截图了