Jump to content

cbox


Help PictureBox Image


codewarrior

Recommended Posts

Posted

Good day is there any body can help or suggest how to fix my problem.

I'am creating OCR using PictureBox and Timer Control. My problem is

when i run my project the picturebox image moving to the right part.

I want to know if there is any way to display stable my image in picturebox

Here is my code under timer sub tick.

 

Public Class Form1

Dim igrab As Bitmap = New Bitmap(270, 100)
Dim icap As Graphics = Graphics.FromImage(igrab)

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
 icap.CopyFromScreen(New Point(Me.Location.X + PictureBox1.Location.X + 4, Me.Location.Y + PictureBox1.Location.Y + 30), _
					 New Point(0, 0), igrab.Size)
 PictureBox1.Image = igrab
End Sub

End Class

 

Sorry for my bad english :)

Thank and advance more power..

Posted

That code looks like its grabbing a portion of the screen everytime the counter ticks? Is that intended as the screen might change. It may be best to move CopyFromScreen outside the tick so it only runs once.

 

Why do you have a timer anyway?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...