Jump to content
shadowrecon

Getcolor--> Bitmap --> Point x,y

Recommended Posts

So you want to search for a color on a bitmap? In that case you could try:

[scar]var

Client: Hwnd;

Bitmap: Integer;

 

begin

// ...

Client := GetClientWindowHandle; // Store client

SetTargetBitmap(Bitmap);

// Search...

SetClientWindowHandle(Client); // Reset client

// ...

end.[/scar]

Link to comment
Share on other sites

How do i make a bitmap from the client, I keep getting a bitmap not assigned error, im assuming i must load the bmp? heres what i have:

function Testing(B: TBox; T: Integer): TIntegerArray;
Var
 BMP, BMP2: Tbitmap;
begin
 CopyClientToBitmap(BMP,B.x1,B.y1,B.x2,B.y2);
 wait(100);
 SmartDebugBitmap(BMP,20,20);
end;

 

---------- Post added at 02:11 AM ---------- Previous post was at 02:01 AM ----------

 

With some digging i figured it out

function Testing(B: TBox; T: Integer): TIntegerArray;
Var
 BMP: integer;
begin
 BMP := BitmapFromString((B.X2-B.X1),(B.Y2-B.Y1), '');
 CopyClientToBitmap(BMP,B.x1,B.y1,B.x2,B.y2);
 wait(100);
 SmartDebugBitmap(BMP,20,20);
 WriteLn(BitmapAssigned(BMP));
 FreeBitmap(BMP);
 WriteLn(BitmapAssigned(BMP));
end;

 

---------- Post added at 03:39 AM ---------- Previous post was at 02:11 AM ----------

 

How can i search a T2DIntArray for a value? is there a function or do i need to make a for loop?

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