Jump to content
xcool3000

Change colour bitmap

Recommended Posts

hello people, im having a problem, i have the following code:

 

procedure LoadBMP;

begin

 

attackbutton := BitmapFromString(10, 8, 'beNoB8AAP/w0W+qWD/' +

'6Fm/8iIqJxvABICAAYKIQADNDxjMTxiV2SK7oZe6Jdl+cOSvKCBDQ' +

'YABwAHEwAQLDtTITNKNUhh+Itd2Zps06+IxZ+FJAAAFgAGCwAZCyA' +

'uGTA9J0BRKkZECQAUOhs6tq+6FSMVDAAAMQAABBQaHSoxHys0AAUF' +

'BwAOGgAWNh8up5yWKA0AJAAAAAcOChYdDxsiQCwuxqu3GQAJDwABw' +

'7WwblBJJQAAAAMJAAYPCRAZRyAe3J2pIQAABQQAipuMnIqDkk5WAw' +

'UNAAAIAAEIXysm85WgMgAAAwMAACAIYlJNyHSHW1dgNTE6D6mCPjc' +

'=');

 

 

end;

 

I am not shore if that is just a color or if it is a color at all, but if it is:

i want to change the colour in it (to 2907022) , i tried with info from the scar divi wiki and it showed up unknown identifier bitmapfromstring, if you could help me i would be greatfull :)

Link to comment
Share on other sites

A bitmap is not A color, it's like a list (array) of colors.. It has pixels, each holding one color. Your bitmap has 80 pixels (10*8), that's 80 colors.

 

And that's not a SCAR 3.4 bitmap, it's from a much older version of SCAR. So I doubt anyone here will help you.

 

In current version of scar (3.4) you can use any of

if you want to change one and one pixel:

BMP.Pixel[x,y] := 2907022;

 

Or sett the whole bitmap (every pixel) to be 2907022

BMP.Clear(2907022)

 

To replace every color that is equal to 0 (black) you could do something along the lines of:

var 
 x, y, repColor, color: Integer;   
 BMP:TSCARBitmap;
begin
 BMP := TSCARBitmap.Create('');
 BMP.SetSize(50,50); 
 DebugBitmap(BMP);
 Wait(500);

 repColor := 0;
 Color := 2907022
 for y:=0 to bmp.Height-1 do
   for x:=0 to bmp.Width-1 do
     if BMP.Pixel[x,y] = repColor then
       BMP.Pixel[x,y] := Color;     

 DebugBitmap(BMP);
end.

Edited by slacky
Link to comment
Share on other sites

I see, so it was set to find a specific array of colours and not just one right?

I tried to replace every color as you said, and the script worked but didn't recognize what i wanted, maybe because the rest of it its configuired to an image and not a color, nevermind, found similar exe bot, tank you ;)

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...