Wizzup?
2012-01-31 13:09:36
Hey everyone.
Today I saw the minor update about ChooseOption, it's probably an easy fix for us. (So by all means, please fix the current one first if you can - then read on)
Then I suddenly wondered about a better way, disregarding the actual colour of the text. I remember I made a function for the Quiz solver that returned a TPA of all the points in a box and not in a TPA. It's called ReturnPointsNotInTPA.
I very quickly wrote this to demonstrate the idea: (Very crude)
So 't2' contains a TPA of all the text. (Including shadow, ATM)
This way we really only need the background colour. The question now is, how much does the background colour vary?
Today I saw the minor update about ChooseOption, it's probably an easy fix for us. (So by all means, please fix the current one first if you can - then read on)
Then I suddenly wondered about a better way, disregarding the actual colour of the text. I remember I made a function for the Quiz solver that returned a TPA of all the points in a box and not in a TPA. It's called ReturnPointsNotInTPA.
I very quickly wrote this to demonstrate the idea: (Very crude)
program new;
var
t, t2: TPointArray;
bmp, w, h, i, bmp2: Integer;
B: TBox;
begin
bmp := LoadBitmap('chooseopt.bmp');
settargetbitmap(bmp);
GetBitmapSize(bmp, w, h);
// any cts works, I was just playing with 3
setcolortolerancespeed(3);
FindColorsTolerance(t, 2563852, 0, 0, w - 1, h - 1, 10);
// get bounds so we don't ``return'' points outside the text box
B := GetTPABounds(t);
// this is magic
ReturnPointsNotInTPAWrap(t, B, t2);
writeln('Length: ' + inttostr(length(t2)));
// draw
bmp2 := CreateBitmap(w, h);
GetMufasaBitmap(bmp2).FastDrawClear(clBlack);
DrawTPABitmap(bmp2, t2, clRed);
DrawBitmapDebugImg(bmp2);
DisplayDebugImgWindow(w, h);
SetDesktopAsClient;
FreeBitmap(bmp);
end.
So 't2' contains a TPA of all the text. (Including shadow, ATM)
This way we really only need the background colour. The question now is, how much does the background colour vary?