中文字幕理论片,69视频免费在线观看,亚洲成人app,国产1级毛片,刘涛最大尺度戏视频,欧美亚洲美女视频,2021韩国美女仙女屋vip视频

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
在VB.NET中進(jìn)行抓屏


Public Class Form1
    Inherits System.Windows.Forms.Form
#Region " Windows 窗體設(shè)計(jì)器生成的代碼 "
    Public Sub New()
        MyBase.New()
        ’該調(diào)用是 Windows 窗體設(shè)計(jì)器所必需的。
        InitializeComponent()
        ’在 InitializeComponent() 調(diào)用之后添加任何初始化
    End Sub
    ’窗體重寫處置以清理組件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub
    ’Windows 窗體設(shè)計(jì)器所必需的
    Private components As System.ComponentModel.IContainer
    ’注意:以下過程是 Windows 窗體設(shè)計(jì)器所必需的
    ’可以使用 Windows 窗體設(shè)計(jì)器修改此過程。
    ’不要使用代碼編輯器修改它。
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents Button2 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Me.Button1 = New System.Windows.Forms.Button
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        Me.Button2 = New System.Windows.Forms.Button
        Me.SuspendLayout()
        ’
        ’Button1
        ’
        Me.Button1.ForeColor = System.Drawing.Color.Black
        Me.Button1.Location = New System.Drawing.Point(8, 312)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(112, 32)
        Me.Button1.TabIndex = 0
        Me.Button1.Text = "抓屏"
        ’
        ’PictureBox1
        ’
        Me.PictureBox1.Location = New System.Drawing.Point(8, 8)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(392, 288)
        Me.PictureBox1.TabIndex = 4
        Me.PictureBox1.TabStop = False
        ’
        ’Button2
        ’
        Me.Button2.ForeColor = System.Drawing.Color.Black
        Me.Button2.Location = New System.Drawing.Point(264, 312)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(112, 32)
        Me.Button2.TabIndex = 5
        Me.Button2.Text = "保存"
        ’
        ’Form1
        ’
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(192, Byte), CType(255, Byte))
        Me.ClientSize = New System.Drawing.Size(408, 358)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.PictureBox1)
        Me.Controls.Add(Me.Button1)
        Me.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(255, Byte), CType(255, Byte))
        Me.Name = "Form1"
        Me.Text = "wgscd"
        Me.ResumeLayout(False)
    End Sub
#End Region

    ’VB.NET中進(jìn)行圖象捕獲 ,需要先引用一些API,以下是聲明:
    Private Declare Function CreateCompatibleDC Lib "GDI32" (ByVal hDC As Integer) As Integer
    Private Declare Function CreateCompatibleBitmap Lib "GDI32" (ByVal hDC As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
    Private Declare Function SelectObject Lib "GDI32" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer
    Private Declare Function BitBlt Lib "GDI32" (ByVal srchDC As Integer, ByVal srcX As Integer, ByVal srcY As Integer, ByVal srcW As Integer, ByVal srcH As Integer, ByVal desthDC As Integer, ByVal destX As Integer, ByVal destY As Integer, ByVal op As Integer) As Integer
    Private Declare Function DeleteDC Lib "GDI32" (ByVal hDC As Integer) As Integer
    Private Declare Function DeleteObject Lib "GDI32" (ByVal hObj As Integer) As Integer
    Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Integer) As Integer
    Const SRCCOPY As Integer = &HCC0020
    ’將以下代碼添加到Button1_Click事件中:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim hDC, hMDC As Integer
        Dim hBMP, hBMPOld As Integer
        Dim sw, sh As Integer
        hDC = GetDC(0)
        hMDC = CreateCompatibleDC(hDC)
        sw = Screen.PrimaryScreen.Bounds.Width
        sh = Screen.PrimaryScreen.Bounds.Height
        hBMP = CreateCompatibleBitmap(hDC, sw, sh)
        hBMPOld = SelectObject(hMDC, hBMP)
        BitBlt(hMDC, 0, 0, sw, sh, hDC, 0, 0, SRCCOPY)
        hBMP = SelectObject(hMDC, hBMPOld)
        PictureBox1.Image = Image.FromHbitmap(New IntPtr(hBMP))
        DeleteDC(hDC)
        DeleteDC(hMDC)
        DeleteObject(hBMP)
        Me.Button2.Enabled = True
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Button2.Enabled = False
    End Sub
    Dim ofd As New SaveFileDialog
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        ofd.Filter = "jpg file|*.jpg|bmp file|*.bmp"
        Dim bmp As Bitmap = Me.PictureBox1.Image
        If ofd.ShowDialog = DialogResult.OK Then
            bmp.Save(ofd.FileName)
        End If
    End Sub
End Class

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
如何使用Windows Media Encoder抓取攝象頭視頻并且保存為視頻文件??
【收】快速掌握VB.NET控件數(shù)組
IWindowsFormsEditorService 接口的VB.NET例子
用VB.NET做WinForm的應(yīng)用程序(To do with VB.NET WinFor...
關(guān)于C# 查詢 功能的實(shí)現(xiàn)代碼
獲取窗體句柄并操縱它
更多類似文章 >>
生活服務(wù)
熱點(diǎn)新聞
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服