VB.NET屏幕指定区域截图代码,保存到Image中

VB.NET屏幕指定区域截图代码,保存到Image中

    Dim texthwnd As IntPtr  
    texthwnd = FindWindowEx(0, 0, vbNullString, "等待输入验证码")  
      
    Dim pl As SwtPj.WINDOWPLACEMENT  
    GetWindowPlacement(texthwnd, pl)  
      
    Dim image As Bitmap = New Bitmap(119, 34)  
    Dim g As Graphics = Graphics.FromImage(image)  
    ShowWindow(texthwnd, SHOW_WINDOW.SW_SHOWNORMAL)  
    My.Application.DoEvents()  
    SetWindowPos(texthwnd, -1, 0, 0, 0, 0, 3)  
    My.Application.DoEvents()  
    System.Threading.Thread.Sleep(200)  
    g.CopyFromScreen(New Point(pl.rcNormalPosition.Left + 58, pl.rcNormalPosition.Top + 94), New Point(0, 0), New Size(119, 34))  
    me.PictureBox1.Image = CType(image, Image)  

未经允许不得转载:网站SEO|SEO关键词优化|SEO搜索引擎优化|SEO优化方案|西安SEO顾问 » VB.NET屏幕指定区域截图代码,保存到Image中

赞 (0)
分享到: 更多

评论 0