codewarrior Posted September 29, 2012 Report Posted September 29, 2012 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 iswhen 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 pictureboxHere 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..
iBotPeaches Posted September 29, 2012 Report Posted September 29, 2012 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?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.