vb点虐 截图代码 vb 截图

VB点虐 点击按钮后截图,截取被当前窗体挡住的图像作为窗体背景(窗体默认无边框样式)

'没办法,需的把窗口隐藏一下,还的隐藏后延迟一下再截图。

创新互联网站建设公司一直秉承“诚信做人,踏实做事”的原则,不欺瞒客户,是我们最起码的底线! 以服务为基础,以质量求生存,以技术求发展,成交一个客户多一个朋友!专注中小微企业官网定制,做网站、网站制作,塑造企业网络形象打造互联网企业效应。

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

VB截取屏幕

[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 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.NET截屏程序,试过好用,哪位大侠给详细解释一下!另外,怎么把截图加载到Picturebox里?

VB.NT用的是触发事件,一按就会触发,要不你加个timer控渣帆件,延迟一秒

标嫌梁蔽题的问题:你先把图片芹州保存,再加载


网站栏目:vb点虐 截图代码 vb 截图
URL分享:http://scyanting.com/article/ddpdjih.html