Jump to content
BryceTheCoder

Can someone explain BitMap stuff to me please?

Recommended Posts

Ok soo i was on the Wiki trying to find more about Bitmap stuff anndd i have honestly very little clue on it..

Does it try and find an color? Like FindColorTolerance oorr what?

 

This is what reminded me of Bitmap stuff:

existing := BitmapFromString(15, 5,
      'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000' +
      '000000000000000000000000000000000000FFFFFFFFFFFF000000' +
      '000000000000000000000000000000000000000000000000000000' +
      '000000000000000000FFFFFFFFFFFF000000000000000000000000' +
      '000000000000000000000000000000000000000000000000000000' +
      'FFFFFFFFFFFF000000000000000000000000000000000000000000' +
      '000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF' +
      'FFFFFF000000000000000000FFFFFFFFFFFF000000000000FFFFFF' +
      'FFFFFF000000000000');

 

All this random numbers and letters make no sence to me:/ How do you get these and what would you use Bitmaps for? Finding an object oorr? Idk.. i just need some knowledge on it is all:)

Link to comment
Share on other sites

Not exactly. It is trying to find an image, rather than a color.

 

The basic idea is you create an bitmap image of something you want to look for (such as a symbol on the minimap) then search for that image rather than the color of whatever it is you are looking for. Just a alternate way of searching. I would likely use dtms rather than a bitmap, but each has it pros and cons.

 

Look under the Tools menu in SCAR: It has an option to take that string and turn it back into what the original bitmap image is (string to picture) so you can visualize it. Conversely when you are creating one you can use the other tool (picture to string) to turn your search image into a string SCAR can work with.

 

I am not the best one to explain this. I suck at explaining things.

Link to comment
Share on other sites

Heres a Explanation of decoding by Freddy a few months ago posted in FAQ's

 

http://forums.scar-divi.com/showthread.php?914-Bitmap-Encoding&highlight=bitmap%20encoding

 

Heres a summary and a little more information:

 

Scar takes each pixel of the bitmap row by row and analyzed the colors into RGB values each RGB value is then turned into a ANSI character. For instance if the R value was 67 then scar would put "c" and if the G value was 94 then scar would put "^" B value was 82 then scar would put "s" so when the pixel was fully encoded you would end up with "c^s" as the bitmap string and this would go on until all the pixels in the bitmap were finished. Then the string of ansi chars would be compressed with some compression software and used ect.. This is for the "c" type encoding system which has a "c" at the begging of the string. Read the full article to see a working example from freddy! =)

Edited by shadowrecon
Link to comment
Share on other sites

The bitmap he's got up there is actually the oldest type SCAR ever used, it's just a sequence of hex encoded colors.

 

Yeah i know, because the 'c' at the beginning of the string is missing, but he was just asking the in's and outs of bitmaps. Bixby covered the making/retrieving, and i was just trying to explain what the numbers and letters represent because i think the bitmap he posted is just a bunch of random numbers because string to picture just returns a black bitmap with a few white dots.

Link to comment
Share on other sites

You can decrypt this type of bitmap very easily:

 

[scar]var

Bmp, W, H, I, Color: Integer;

Str, Tmp: AnsiString;

 

begin

Str := 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000' +

'000000000000000000000000000000000000FFFFFFFFFFFF000000' +

'000000000000000000000000000000000000000000000000000000' +

'000000000000000000FFFFFFFFFFFF000000000000000000000000' +

'000000000000000000000000000000000000000000000000000000' +

'FFFFFFFFFFFF000000000000000000000000000000000000000000' +

'000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF' +

'FFFFFF000000000000000000FFFFFFFFFFFF000000000000FFFFFF' +

'FFFFFF000000000000';

W := 15;

H := 5;

 

Bmp := BitmapFromString(W, H, '');

try

for I := 0 to Length(Str) div 6 - 1 do

begin

Tmp := HexToStr(Copy(Str, I * 6 + 1, 6));

Color := RGBToColor(Byte(Tmp[1]), Byte(Tmp[2]), Byte(Tmp[3]));

FastSetPixel(Bmp, I mod W, I div W, Color);

end;

DebugBitmap(Bmp);

finally

FreeBitmap(Bmp);

end;

end.[/scar]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...