Me.Refresh()
成都創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供義馬網(wǎng)站建設、義馬做網(wǎng)站、義馬網(wǎng)站設計、義馬網(wǎng)站制作等企業(yè)網(wǎng)站建設、網(wǎng)頁設計與制作、義馬企業(yè)網(wǎng)站模板建站服務,10余年義馬做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡服務。
Dim?memory?As?Image?=?New?Bitmap(Me.Width,?Me.Height)
Dim?g?As?Graphics?=?Graphics.FromImage(memory)
g.CopyFromScreen(Me.Left,?Me.Top,?0,?0,?New?Size(Me.Width,?Me.Height))?'這里是截屏核心代碼
Dim?FilePath?As?String?=?""
Dim?d?As?New?SaveFileDialog
d.Filter?=?"JPEG圖像|*.JPEG"
If?d.ShowDialog?=?Windows.Forms.DialogResult.OK?Then
FilePath?=?d.FileName
If?FilePath?=?""?Then?Exit?Sub
'If?FilePath.Substring(FilePath.Length?-?1,?1)??"\"?Then?FilePath?=?FilePath??"\"
Else
Exit?Sub
End?If
d.Dispose()
memory.Save(FilePath)
MessageBox.Show("圖像已經(jīng)保存到:?"??FilePath,?"截圖成功",?MessageBoxButtons.OK,?MessageBoxIcon.Information)
1,用VB截取DirectX窗口內(nèi)容的程序,最好能夠直截取窗口的內(nèi)容,不要窗口標題欄VB.NET中利用 GDI 就可以截圖,DX 也不例外。 先聲明 Imports System.
vb.net 怎么來回切換圖片?1、添加控件Picturebox1和控件Timer1,將Timer1的Interval屬性改為1000(即1秒),Enabled屬性改為True
2、假設你要循環(huán)切換4張圖片,你可以添加如下代碼即可實現(xiàn):
Dim a As Integer = 0
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If a = 4 Then
a = 0
Else
a = a + 1
End If
If a = 0 Then Me.PictureBox1.Image = Image.FromFile("1.jpg")
If a = 1 Then Me.PictureBox1.Image = Image.FromFile("2.jpg")
If a = 2 Then Me.PictureBox1.Image = Image.FromFile("3.jpg")
If a = 3 Then Me.PictureBox1.Image = Image.FromFile("4.jpg")
End Sub
'沒辦法,需的把窗口隱藏一下,還的隱藏后延遲一下再截圖。
Dim?WithEvents?Timer1?As?New?Timer?With?{.Interval?=?30,?.Enabled?=?False}
Dim?Imgrect?As?Rectangle
Dim?img?As?Bitmap
Private?Sub?Button1_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?Button1.Click
Imgrect?=?Me.RectangleToScreen(Me.ClientRectangle)
img?=?New?Bitmap(Imgrect.Width,?Imgrect.Height)
Me.Hide()
Timer1.Start()
End?Sub
Private?Sub?Timer1_Tick(ByVal?sender?As?Object,?ByVal?e?As?System.EventArgs)?Handles?Timer1.Tick
Timer1.Stop()
Graphics.FromImage(img).CopyFromScreen(Imgrect.X,?Imgrect.Y,?0,?0,?Imgrect.Size)
Me.BackgroundImage?=?img
Me.Show()
End?Sub
INTOUCH自帶的就有,打印屏幕的命令
自己寫個時間條件運行那命令就可以了
PRINTSCREEN這個命令 具體怎么用 看下幫助
希望我的回答對你有所幫助
如有其他問題,可以繼續(xù)追問,您的采納是我前進的動力!
本文標題:vb.net截圖,vb程序怎么截圖
路徑分享:http://jinyejixie.com/article8/dssooip.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、網(wǎng)站建設、品牌網(wǎng)站設計、網(wǎng)站制作、App開發(fā)、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)