Nesne = wb1.Document.DomDocument.body.createControlRange()
Nesne.Add(wb1.Document.Images(0).DomElement)
Nesne.execCommand("Copy")
Resim = My.Computer.Clipboard.GetImage()
Dim image As Bitmap = New Bitmap(Resim)
pb1.Image = image
Dim img As Bitmap = New Bitmap(image)
Dim clr As Integer
For x = 0 To img.Width - 1
For y = 0 To img.Height - 1
clr = (CInt(img.GetPixel(x, y).R) +
img.GetPixel(x, y).G +
img.GetPixel(x, y).B) \ 3
img.SetPixel(x, y, Color.FromArgb(clr, clr, clr))
Next y
Next x
Dim ocr = New Tesseract()
ocr.SetVariable("tessedit_char_whitelist", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
ocr.Init(Application.StartupPath & "\tessdata", "eng", False)
Dim result = ocr.DoOCR(img, Rectangle.Empty)
For Each word As Word In result
guvenlikkodu = guvenlikkodu & word.Text
'Console.WriteLine("{0} : {1}", word.Confidence, word.Text)
Next