大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
'没办法,需的把窗口隐藏一下,还的隐藏后延迟一下再截图。
创新互联网站建设公司一直秉承“诚信做人,踏实做事”的原则,不欺瞒客户,是我们最起码的底线! 以服务为基础,以质量求生存,以技术求发展,成交一个客户多一个朋友!专注中小微企业官网定制,做网站、网站制作,塑造企业网络形象打造互联网企业效应。
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
[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);
先历桥找到你要截图的那个窗体的 句柄 然后根据这个句柄得到陆卖改窗体的DC 创建一个bitmap 然后填充 得到的bitmap后 显示到picturebox里面
学习vb vb点虐 java php ps office的朋友欢迎来歪歪频道4350,小小虾~宣 !
vb 的 仿QQ拼音截图,代码给你了,新建个记事本,然后复制下面的内容保存,然后把记事本的后缀名改为.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
VB.NT用的是触发事件,一按就会触发,要不你加个timer控渣帆件,延迟一秒
标嫌梁蔽题的问题:你先把图片芹州保存,再加载