Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How To Make A Magnifier In Microsoft Visual Basic
- ~
- Requirements:
- - Timer1 (Enabled: True) (Interval: 1)
- - PictureBox (SizeMode: StretchImage) (DockL FiLL)
- Right mouse-click the form and choose "View Code"
- Paste the code below to the code section.
- ~
- Public Function capturescreen(ByVal links As Integer, ByVal rechts As Integer) As Bitmap
- Dim b As New Bitmap(CInt(PictureBox1.Width / 2), CInt(PictureBox1.Height / 2))
- Dim g As Graphics = Graphics.FromImage(b)
- g.CopyFromScreen(links - (PictureBox1.Width / 4), rechts - (PictureBox1.Height / 4), 0, 0, b.Size)
- g.Dispose()
- Return b
- End Function
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- PictureBox1.Image = capturescreen(MousePosition.X, MousePosition.Y)
- End Sub
- -- DEBUG! --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement