亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 如何將picturebox中的圖形與控件一起轉換為bmp圖.txt

?? 以電子書的形式收集了VB一些常見問題解決方法,可以很方便的查找自己需要解決的問題.對一些VB初學者很用.
?? TXT
字號:
下 面 的 方 法 實 際 上 是 抓 取 屏 幕 圖 象 的 方 法 。 
    如 果 要 得 到 一 個 PictureBox中 的 圖 形 ( 不 包 括 覆 蓋 在 其 上 的 控 件 ) , 可 以 使 用 SavePicture Picture1.Picture "c:\test.bmp"語 句 將 圖 形 存 盤 。 這 種 方 法 不 管 整 個 圖 形 部 分 是 否 可 見 , 都 可 以 保 存 下 來 。 
    如 果 要 包 括 覆 蓋 在 其 上 的 控 件 , 可 以 用 下 面 的 辦 法 : 
    首 先 建 立 一 個 模 塊 , 輸 入 以 下 內 容 : 
    Private Type PALETTEENTRY 
     peRed As Byte 
     peGreen As Byte 
     peBlue As Byte 
     peFlags As Byte 
    End Type 
     
    Private Type LOGPALETTE 
     palVersion As Integer 
     palNumEntries As Integer 
     palPalEntry(255) As PALETTEENTRY ' Enough for 256 colors. 
    End Type 
     
    Private Type GUID 
     Data1 As Long 
     Data2 As Integer 
     Data3 As Integer 
     Data4(7) As Byte 
    End Type 
     
    #If Win32 Then 
     
     Private Const RASTERCAPS As Long = 38 
     Private Const RC_PALETTE As Long = &H100 
     Private Const SIZEPALETTE As Long = 104 
     
     Private Type RECT 
     Left As Long 
     Top As Long 
     Right As Long 
     Bottom As Long 
     End Type 
     
     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 GetDeviceCaps Lib "GDI32" ( _ 
     ByVal hDC As Long, ByVal iCapabilitiy As Long) As Long 
     Private Declare Function GetSystemPaletteEntries Lib "GDI32" ( _ 
     ByVal hDC As Long, ByVal wStartIndex As Long, _ 
     ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) _ 
     As Long 
     Private Declare Function CreatePalette Lib "GDI32" ( _ 
     lpLogPalette As LOGPALETTE) As Long 
     Private Declare Function SelectObject Lib "GDI32" ( _ 
     ByVal hDC As Long, ByVal hObject As Long) As Long 
     Private Declare Function BitBlt Lib "GDI32" ( _ 
     ByVal hDCDest As Long, ByVal XDest As Long, _ 
     ByVal YDest As Long, ByVal nWidth As Long, _ 
     ByVal nHeight As Long, ByVal hDCSrc As Long, _ 
     ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) _ 
     As Long 
     Private Declare Function DeleteDC Lib "GDI32" ( _ 
     ByVal hDC As Long) As Long 
     Private Declare Function GetForegroundWindow Lib "USER32" () _ 
     As Long 
     Private Declare Function SelectPalette Lib "GDI32" ( _ 
     ByVal hDC As Long, ByVal hPalette As Long, _ 
     ByVal bForceBackground As Long) As Long 
     Private Declare Function RealizePalette Lib "GDI32" ( _ 
     ByVal hDC As Long) As Long 
     Private Declare Function GetWindowDC Lib "USER32" ( _ 
     ByVal hWnd As Long) As Long 
     Private Declare Function GetDC Lib "USER32" ( _ 
     ByVal hWnd As Long) As Long 
     Private Declare Function GetWindowRect Lib "USER32" ( _ 
     ByVal hWnd As Long, lpRect As RECT) As Long 
     Private Declare Function ReleaseDC Lib "USER32" ( _ 
     ByVal hWnd As Long, ByVal hDC As Long) As Long 
     Private Declare Function GetDesktopWindow Lib "USER32" () As Long 
     
     Private Type PicBmp 
     Size As Long 
     Type As Long 
     hBmp As Long 
     hPal As Long 
     Reserved As Long 
     End Type 
     
     Private Declare Function OleCreatePictureIndirect _ 
     Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, _ 
     ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long 
     
    #ElseIf Win16 Then 
     
     Private Const RASTERCAPS As Integer = 38 
     Private Const RC_PALETTE As Integer = &H100 
     Private Const SIZEPALETTE As Integer = 104 
     
     Private Type RECT 
     Left As Integer 
     Top As Integer 
     Right As Integer 
     Bottom As Integer 
     End Type 
     
     Private Declare Function CreateCompatibleDC Lib "GDI" ( _ 
     ByVal hDC As Integer) As Integer 
     Private Declare Function CreateCompatibleBitmap Lib "GDI" ( _ 
     ByVal hDC As Integer, ByVal nWidth As Integer, _ 
     ByVal nHeight As Integer) As Integer 
     Private Declare Function GetDeviceCaps Lib "GDI" ( _ 
     ByVal hDC As Integer, ByVal iCapabilitiy As Integer) As Integer 
     Private Declare Function GetSystemPaletteEntries Lib "GDI" ( _ 
     ByVal hDC As Integer, ByVal wStartIndex As Integer, _ 
     ByVal wNumEntries As Integer, _ 
     lpPaletteEntries As PALETTEENTRY) As Integer 
     Private Declare Function CreatePalette Lib "GDI" ( _ 
     lpLogPalette As LOGPALETTE) As Integer 
     Private Declare Function SelectObject Lib "GDI" ( _ 
     ByVal hDC As Integer, ByVal hObject As Integer) As Integer 
     Private Declare Function BitBlt Lib "GDI" ( _ 
     ByVal hDCDest As Integer, ByVal XDest As Integer, _ 
     ByVal YDest As Integer, ByVal nWidth As Integer, _ 
     ByVal nHeight As Integer, ByVal hDCSrc As Integer, _ 
     ByVal XSrc As Integer, ByVal YSrc As Integer, _ 
     ByVal dwRop As Long) As Integer 
     Private Declare Function DeleteDC Lib "GDI" ( _ 
     ByVal hDC As Integer) As Integer 
     Private Declare Function GetForegroundWindow Lib "USER" _ 
     Alias "GetActiveWindow" () As Integer 
     Private Declare Function SelectPalette Lib "USER" ( _ 
     ByVal hDC As Integer, ByVal hPalette As Integer, ByVal _ 
     bForceBackground As Integer) As Integer 
     Private Declare Function RealizePalette Lib "USER" ( _ 
     ByVal hDC As Integer) As Integer 
     Private Declare Function GetWindowDC Lib "USER" ( _ 
     ByVal hWnd As Integer) As Integer 
     Private Declare Function GetDC Lib "USER" ( _ 
     ByVal hWnd As Integer) As Integer 
     Private Declare Function GetWindowRect Lib "USER" ( _ 
     ByVal hWnd As Integer, lpRect As RECT) As Integer 
     Private Declare Function ReleaseDC Lib "USER" ( _ 
     ByVal hWnd As Integer, ByVal hDC As Integer) As Integer 
     Private Declare Function GetDesktopWindow Lib "USER" () As Integer 
     
     Private Type PicBmp 
     Size As Integer 
     Type As Integer 
     hBmp As Integer 
     hPal As Integer 
     Reserved As Integer 
     End Type 
     
     Private Declare Function OleCreatePictureIndirect _ 
     Lib "oc25.dll" (PictDesc As PicBmp, RefIID As GUID, _ 
     ByVal fPictureOwnsHandle As Integer, IPic As IPicture) _ 
     As Integer 
    #End If 
    #If Win32 Then 
     Public Function CaptureWindow(ByVal hWndSrc As Long, _ 
     ByVal Client As Boolean, ByVal LeftSrc As Long, _ 
     ByVal TopSrc As Long, ByVal WidthSrc As Long, _ 
     ByVal HeightSrc As Long) As Picture 
     
     Dim hDCMemory As Long 
     Dim hBmp As Long 
     Dim hBmpPrev As Long 
     Dim r As Long 
     Dim hDCSrc As Long 
     Dim hPal As Long 
     Dim hPalPrev As Long 
     Dim RasterCapsScrn As Long 
     Dim HasPaletteScrn As Long 
     Dim PaletteSizeScrn As Long 
    #ElseIf Win16 Then 
     Public Function CaptureWindow(ByVal hWndSrc As Integer, _ 
     ByVal Client As Boolean, ByVal LeftSrc As Integer, _ 
     ByVal TopSrc As Integer, ByVal WidthSrc As Long, _ 
     ByVal HeightSrc As Long) As Picture 
     
     Dim hDCMemory As Integer 
     Dim hBmp As Integer 
     Dim hBmpPrev As Integer 
     Dim r As Integer 
     Dim hDCSrc As Integer 
     Dim hPal As Integer 
     Dim hPalPrev As Integer 
     Dim RasterCapsScrn As Integer 
     Dim HasPaletteScrn As Integer 
     Dim PaletteSizeScrn As Integer 
    #End If 
     Dim LogPal As LOGPALETTE 
     
     ' Depending on the value of Client get the proper device context. 
     If Client Then 
     hDCSrc = GetDC(hWndSrc) ' Get device context for client area. 
     Else 
     hDCSrc = GetWindowDC(hWndSrc) ' Get device context for entire 
     ' window. 
     End If 
     
     ' Create a memory device context for the copy process. 
     hDCMemory = CreateCompatibleDC(hDCSrc) 
     ' Create a bitmap and place it in the memory DC. 
     hBmp = CreateCompatibleBitmap(hDCSrc, WidthSrc, HeightSrc) 
     hBmpPrev = SelectObject(hDCMemory, hBmp) 
     
     ' Get screen properties. 
     RasterCapsScrn = GetDeviceCaps(hDCSrc, RASTERCAPS) ' Raster 
     ' capabilities. 
     HasPaletteScrn = RasterCapsScrn And RC_PALETTE ' Palette 
     ' support. 
     PaletteSizeScrn = GetDeviceCaps(hDCSrc, SIZEPALETTE) ' Size of 
     ' palette. 
     
     ' If the screen has a palette make a copy and realize it. 
     If HasPaletteScrn And (PaletteSizeScrn = 256) Then 
     ' Create a copy of the system palette. 
     LogPal.palVersion = &H300 
     LogPal.palNumEntries = 256 
     r = GetSystemPaletteEntries(hDCSrc, 0, 256, _ 
     LogPal.palPalEntry(0)) 
     hPal = CreatePalette(LogPal) 
     ' Select the new palette into the memory DC and realize it. 
     hPalPrev = SelectPalette(hDCMemory, hPal, 0) 
     r = RealizePalette(hDCMemory) 
     End If 
     
     ' Copy the on-screen image into the memory DC. 
     r = BitBlt(hDCMemory, 0, 0, WidthSrc, HeightSrc, hDCSrc, _ 
     LeftSrc, TopSrc, vbSrcCopy) 
     
    ' Remove the new copy of the on-screen image. 
     hBmp = SelectObject(hDCMemory, hBmpPrev) 
     
     ' If the screen has a palette get back the palette that was 
     ' selected in previously. 
     If HasPaletteScrn And (PaletteSizeScrn = 256) Then 
     hPal = SelectPalette(hDCMemory, hPalPrev, 0) 
     End If 
     
     ' Release the device context resources back to the system. 
     r = DeleteDC(hDCMemory) 
     r = ReleaseDC(hWndSrc, hDCSrc) 
     
     ' Call CreateBitmapPicture to create a picture object from the 
     ' bitmap and palette handles. Then return the resulting picture 
     ' object. 
     Set CaptureWindow = CreateBitmapPicture(hBmp, hPal) 
    End Function 
     
    #If Win32 Then 
     Public Function CreateBitmapPicture(ByVal hBmp As Long, _ 
     ByVal hPal As Long) As Picture 
     
     Dim r As Long 
    #ElseIf Win16 Then 
     Public Function CreateBitmapPicture(ByVal hBmp As Integer, _ 
     ByVal hPal As Integer) As Picture 
     
     Dim r As Integer 
    #End If 
     Dim Pic As PicBmp 
     ' IPicture requires a reference to "Standard OLE Types." 
     Dim IPic As IPicture 
     Dim IID_IDispatch As GUID 
     
     ' Fill in with IDispatch Interface ID. 
     With IID_IDispatch 
     .Data1 = &H20400 
     .Data4(0) = &HC0 
     .Data4(7) = &H46 
     End With 
     
     ' Fill Pic with necessary parts. 
     With Pic 
     .Size = Len(Pic) ' Length of structure. 
     .Type = vbPicTypeBitmap ' Type of Picture (bitmap). 
     .hBmp = hBmp ' Handle to bitmap. 
     .hPal = hPal ' Handle to palette (may be null). 
     End With 
     
     ' Create Picture object. 
     r = OleCreatePictureIndirect(Pic, IID_IDispatch, 1, IPic) 
     
     ' Return the new Picture object. 
     Set CreateBitmapPicture = IPic 
    End Function 
     
    只 要 使 用 以 下 語 句 就 可 以 完 成 你 所 要 求 的 任 務 。 
    SavePicture CaptureWindow(Picture1.hWnd, False, 0, 0, _ 
     Picture1.ScaleX(Picture1.Width, vbTwips, vbPixels), _ 
     Picture1.ScaleY(Picture1.Height, vbTwips, vbPixels)) _ 
     , "C:\test.bmp" 
    這 時 保 存 的 是 可 見 部 分 , 如 果 要 保 存 不 可 見 的 PictureBox中 的 背 景 , 可 以 這 樣 : 
    Picture2.Picture = Picture1.Picture 
    Picture2.PaintPicture CaptureWindow(Picture1.hWnd, False, 0, 0, _ 
     Picture1.ScaleX(Picture1.Width, vbTwips, vbPixels), _ 
     Picture1.ScaleY(Picture1.Height, vbTwips, vbPixels)), 0, 0 
    SavePicture Picture2.Picture "c:\test.bmp" 
    事 實 上 , CaptureWindow可 以 截 取 任 何 窗 口 的 圖 象 。 
<END>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美国产麻豆| 亚洲日本在线视频观看| 亚洲午夜激情网站| 日韩一区二区电影网| 免费看日韩a级影片| 久久精子c满五个校花| 成人av影院在线| 亚洲成av人**亚洲成av**| 56国语精品自产拍在线观看| 裸体歌舞表演一区二区| 亚洲手机成人高清视频| 日韩欧美国产高清| 色久综合一二码| 国产成人免费视频网站高清观看视频 | 亚洲国产成人tv| 久久毛片高清国产| 欧美精品黑人性xxxx| 99久久免费精品| 日本不卡中文字幕| 亚洲一线二线三线久久久| 国产欧美日韩精品a在线观看| 一本到一区二区三区| 高清不卡一二三区| 美女看a上一区| 日韩精品电影在线| 亚洲一区二区三区视频在线 | 国产精品日产欧美久久久久| 成人小视频免费在线观看| 日韩avvvv在线播放| 亚洲男人的天堂在线观看| 国产精品无遮挡| 中文一区二区完整视频在线观看| 日韩欧美久久一区| 久久蜜桃香蕉精品一区二区三区| 精品粉嫩aⅴ一区二区三区四区| 69av一区二区三区| 精品国内片67194| 久久精品一区二区三区av| 日本一区二区三区高清不卡| 国产午夜亚洲精品午夜鲁丝片| 久久色在线视频| 国产精品久久久久久久久免费樱桃 | 国内久久精品视频| 成人动漫中文字幕| 在线一区二区三区四区五区| 色94色欧美sute亚洲线路二 | 欧美另类久久久品| 26uuu精品一区二区三区四区在线| 久久久久久久综合日本| 日韩精品专区在线| 精品免费日韩av| 亚洲综合成人在线| 国产成人综合在线播放| 91久久免费观看| 久久蜜桃av一区二区天堂 | 亚洲一区二区三区三| 蜜臀久久久久久久| av影院午夜一区| 久久久久久久国产精品影院| 一区二区视频免费在线观看| 另类中文字幕网| 91精品国产综合久久精品性色| 久久久一区二区三区捆绑**| 亚洲美女一区二区三区| 国产毛片精品视频| 久久综合久久综合亚洲| 午夜视频一区二区| 91亚洲国产成人精品一区二三 | 久久久久国产精品人| 日韩在线一区二区| 91色在线porny| 亚洲视频在线观看三级| 色综合av在线| 亚洲国产美女搞黄色| 在线看不卡av| 亚洲一级二级在线| 欧美在线|欧美| 日本麻豆一区二区三区视频| 欧美猛男超大videosgay| 亚洲国产精品久久久久秋霞影院| 色噜噜狠狠色综合中国| 亚洲永久免费视频| 欧美日韩欧美一区二区| 麻豆国产欧美日韩综合精品二区 | 欧美色网一区二区| 美女精品一区二区| 国产精品九色蝌蚪自拍| 91小视频免费观看| 日韩av一区二区三区| 国产性天天综合网| 欧美午夜电影网| 久久国产精品色婷婷| 国产精品三级久久久久三级| 欧美视频完全免费看| 韩国女主播一区| 亚洲一区二区三区激情| 精品美女被调教视频大全网站| 成人h动漫精品一区二区| 日韩精品一级二级| 亚洲人成电影网站色mp4| 日韩欧美国产系列| 欧美在线一区二区| 99久久99久久综合| 国产成人av电影在线| 日韩国产在线观看| 午夜精品久久久久久久| 亚洲黄网站在线观看| 中文字幕在线不卡国产视频| 精品毛片乱码1区2区3区| 8x8x8国产精品| 91精品免费观看| 欧美日韩一卡二卡三卡| 91猫先生在线| 一本色道久久综合亚洲精品按摩| 国产成人午夜视频| 久久国产日韩欧美精品| 日本aⅴ亚洲精品中文乱码| 亚洲国产综合色| 亚洲成人精品一区二区| 日韩av网站在线观看| 奇米在线7777在线精品 | 丝袜美腿亚洲一区| 看国产成人h片视频| 国产大陆a不卡| 91丨porny丨户外露出| 91最新地址在线播放| 色94色欧美sute亚洲线路一久| 欧洲另类一二三四区| 91超碰这里只有精品国产| 日韩精品一区二区在线观看| 国产亚洲欧美日韩日本| 亚洲日本在线看| 美女视频网站黄色亚洲| 大白屁股一区二区视频| 欧美在线你懂得| 国产日韩欧美精品在线| 亚洲一区二区视频| 国产成人午夜精品5599| 777精品伊人久久久久大香线蕉| 久久日韩精品一区二区五区| 亚洲欧洲三级电影| 免费观看在线色综合| www.欧美日韩国产在线| 日韩欧美美女一区二区三区| 亚洲天堂精品视频| 国产成人av在线影院| 欧美精品一区二区三区蜜臀| 亚洲午夜久久久久久久久电影院 | 久久精品亚洲一区二区三区浴池| ...中文天堂在线一区| 国产成人av一区二区三区在线| 欧美日韩国产一区| 亚洲第一福利一区| 欧美三电影在线| 亚洲在线观看免费| 色婷婷综合久色| 亚洲免费观看高清| 91黄色激情网站| 一区二区三区美女| 成+人+亚洲+综合天堂| 国产精品女主播av| 91免费国产在线观看| 亚洲永久精品大片| 欧美网站一区二区| 日韩av在线免费观看不卡| 日韩免费观看高清完整版| 美日韩黄色大片| 国产日韩欧美在线一区| 91免费版在线| 日韩不卡在线观看日韩不卡视频| 欧美日韩一级二级| 国产一区二区影院| 一区av在线播放| 精品日韩一区二区| 在线观看日韩国产| 美女视频黄频大全不卡视频在线播放| 欧美一级片在线看| 不卡av电影在线播放| 日本伊人色综合网| 亚洲同性同志一二三专区| 欧美精品自拍偷拍| 97国产精品videossex| 久久se精品一区精品二区| 亚洲黄一区二区三区| 国产欧美一区二区三区在线老狼| 色网站国产精品| 成人综合激情网| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品国产三级国产aⅴ中文 | 欧美剧情电影在线观看完整版免费励志电影| 视频在线观看国产精品| 一区二区三区精品| 日韩一区欧美一区| 亚洲二区视频在线| 久久精品亚洲国产奇米99| 欧美日韩中文精品| 蜜臀av性久久久久蜜臀aⅴ| 日韩片之四级片| 在线电影一区二区三区| 国产精品性做久久久久久|