• Log in or sign up for an account here: https://www.sythe.org/login

OCR text identifing in scar?

  • Thread starter Thread starter shadowpwner
  • Start date Start date
S

shadowpwner

Guest
how would I go upon using scar to search for the font on a webpage , and return what it typed in plain text on the debug window?

suppose the page had Hello World in time new roman, but it was an image. How would i go about using SCAR to identify what the text says and show it in the debug window?

HTML:
program FontTest;
const

  fontname      = 'Tahoma';
  size          = 16;
  bold          = false;
  italic        = false;
  underline     = false;
  strikethrough = false;
var
  font, bitmap, sizex, sizey: integer;
begin
  //Load the font into memory
  font := LoadCharsFromFont2(fontname, size, bold, italic, underline, strikethrough);
 
  //Generate a bitmap mask from the previously loaded font
  bitmap := CreateBitmapMaskFromText('Hello', font);
 end.

This is the code so far I made, how do I identify the text on a website?
 
GetPage('');

Will return everything on that page has a string. You can use Between(''); to shrink it down to what yoy want.
 
thanks, however GetPage only returns HTTP webpage contents as string. However, the text i want to find is in an image.
 
Code:
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(Bitmap), 0, 0, 0, 0, 0, 0, 0, 0);
 
thanks, but as me being a scar noob, im not sure how to implement this on to my existing script.

Would I have to make a a bitmap of each letter to make

SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(Bitmap), 0, 0, 0, 0, 0, 0, 0, 0);

work?

ohyeah, if I didn't mention this, the Hello World image changes words every time I goto that webpage. Like sometime it will say hello world, sometime hi, etc.
 
thanks, but as me being a scar noob, im not sure how to implement this on to my existing script.

Would I have to make a a bitmap of each letter to make

SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(Bitmap), 0, 0, 0, 0, 0, 0, 0, 0);

work?

No, set the coordinates of where to pick the picture off the canvas and then the coordinates to copy that onto the bitmap.

ohyeah, if I didn't mention this, the Hello World image changes words every time I goto that webpage. Like sometime it will say hello world, sometime hi, etc.

You will have to make a bitmap of each phrase and then compare the two bitmaps to see if they are the same. So. . . Make them into an array and then use For etc Do etc if (etc = etc) then break; etc.
 
duelarena.gg
Back
Top