INTOUCH自帶的就有,打印屏幕的命令
創(chuàng)新互聯(lián)是一家專注于網(wǎng)站設(shè)計(jì)制作、成都做網(wǎng)站與策劃設(shè)計(jì),章貢網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10余年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:章貢等地區(qū)。章貢做網(wǎng)站價(jià)格咨詢:18982081108
自己寫個(gè)時(shí)間條件運(yùn)行那命令就可以了
PRINTSCREEN這個(gè)命令 具體怎么用 看下幫助
希望我的回答對(duì)你有所幫助
如有其他問(wèn)題,可以繼續(xù)追問(wèn),您的采納是我前進(jìn)的動(dòng)力!
[DllImport("user32.dll", EntryPoint = "GetDC")]
public static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("user32.dll", EntryPoint = "ReleaseDC")]
public static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDC);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
先找到你要截圖的那個(gè)窗體的 句柄 然后根據(jù)這個(gè)句柄得到改窗體的DC 創(chuàng)建一個(gè)bitmap 然后填充 得到的bitmap后 顯示到picturebox里面
學(xué)習(xí)vb vb.net java php ps office的朋友歡迎來(lái)歪歪頻道4350,小小蝦~宣 !
vb 的 仿QQ拼音截圖,代碼給你了,新建個(gè)記事本,然后復(fù)制下面的內(nèi)容保存,然后把記事本的后綴名改為.frm
VERSION 5.00
Begin VB.Form VB模擬QQ截屏
BorderStyle = 0 'None
Caption = "模擬QQ截屏"
ClientHeight = 5310
ClientLeft = 0
ClientTop = 0
ClientWidth = 6180
Icon = "模擬QQ截屏.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
ScaleHeight = 5310
ScaleWidth = 6180
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
BackColor = H00F8E2DE
BorderStyle = 0 'None
Height = 390
Left = 0
ScaleHeight = 390
ScaleWidth = 3075
TabIndex = 0
Top = 0
Visible = 0 'False
Width = 3080
Begin VB.Line Line1
BorderColor = H00FFC0C0
X1 = 1620
X2 = 1620
Y1 = 40
Y2 = 320
End
Begin VB.Label lblInfo
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = H80000005
BackStyle = 0 'Transparent
Caption = "Label2"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = H00EC7A00
Height = 255
Left = 45
TabIndex = 2
Top = 75
Width = 1540
End
'沒辦法,需的把窗口隱藏一下,還的隱藏后延遲一下再截圖。
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
1,建立工程,在form1 上放一個(gè)picture框
2,把下面的代碼放到代碼區(qū)
3,f5測(cè)試,會(huì)在工程目錄下生成一個(gè)jpg.里面的壓縮參數(shù)和保存位置你自己可調(diào)整
---------------------灰常nb的分割線--------------------
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GdiplusStartup Lib "GDIPlus" (token As Long, inputbuf As GdiplusStartupInput, ByVal outputbuf As Long) As Long
Private Declare Function GdiplusShutdown Lib "GDIPlus" (ByVal token As Long) As Long
Private Declare Function GdipCreateBitmapFromHBITMAP Lib "GDIPlus" (ByVal hbm As Long, ByVal hpal As Long, Bitmap As Long) As Long
Private Declare Function GdipDisposeImage Lib "GDIPlus" (ByVal Image As Long) As Long
Private Declare Function GdipSaveImageToFile Lib "GDIPlus" (ByVal Image As Long, ByVal filename As Long, clsidEncoder As GUID, encoderParams As Any) As Long
Private Declare Function CLSIDFromString Lib "ole32" (ByVal str As Long, id As GUID) As Long
Private Declare Function GdipCreateBitmapFromFile Lib "GDIPlus" (ByVal filename As Long, Bitmap As Long) As Long
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Type GdiplusStartupInput
GdiplusVersion As Long
DebugEventCallback As Long
SuppressBackgroundThread As Long
SuppressExternalCodecs As Long
End Type
Private Type EncoderParameter
GUID As GUID
NumberOfValues As Long
type As Long
Value As Long
End Type
Private Type EncoderParameters
Count As Long
Parameter As EncoderParameter
End Type
Private Sub Form_Load()
Dim rFN As String
Dim ret As Boolean
rFN = getFN
Me.Hide
Me.AutoRedraw = True
Picture1.Width = Screen.Width + 30
Picture1.Height = Screen.Height + 30
BitBlt Picture1.hDC, 0, 0, Screen.Width + 30, Screen.Height + 30, GetDC(0), 0, 0, vbSrcCopy
Set Picture1.Picture = Picture1.Image
ret = PictureBoxSaveJPG(Picture1.Picture, Replace(App.Path "\" rFN ".JPG", "\\", "\")) '保存壓縮后的圖片
End
End Sub
Function getFN() As String
Dim dD As String, tT As String
dD = Replace(CStr(Date), "-", ""): tT = Replace(CStr(Time), ":", "")
tT = Replace(tT, "下午", "pm"): tT = Replace(tT, "上午", "am")
getFN = Replace(dD tT, " ", "")
End Function
Private Function PictureBoxSaveJPG(ByVal pict As StdPicture, ByVal filename As String, Optional ByVal quality As Byte = 80) As Boolean
Dim tSI As GdiplusStartupInput
Dim lRes As Long
Dim lGDIP As Long
Dim lBitmap As Long
'初始化 GDI+
tSI.GdiplusVersion = 1
lRes = GdiplusStartup(lGDIP, tSI, 0)
If lRes = 0 Then
'從句柄創(chuàng)建 GDI+ 圖像
lRes = GdipCreateBitmapFromHBITMAP(pict.Handle, 0, lBitmap)
If lRes = 0 Then
Dim tJpgEncoder As GUID
Dim tParams As EncoderParameters
'初始化解碼器的GUID標(biāo)識(shí)
CLSIDFromString StrPtr("{557CF401-1A04-11D3-9A73-0000F81EF32E}"), tJpgEncoder
'設(shè)置解碼器參數(shù)
tParams.Count = 1
With tParams.Parameter ' Quality
'得到Quality參數(shù)的GUID標(biāo)識(shí)
CLSIDFromString StrPtr("{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB}"), .GUID
.NumberOfValues = 1
.type = 4
.Value = VarPtr(quality)
End With
'保存圖像
lRes = GdipSaveImageToFile(lBitmap, StrPtr(filename), tJpgEncoder, tParams)
'銷毀GDI+圖像
GdipDisposeImage lBitmap
End If
'銷毀 GDI+
GdiplusShutdown lGDIP
End If
If lRes Then
PictureBoxSaveJPG = False
Else
PictureBoxSaveJPG = True
End If
End Function