shadowrecon Posted February 11, 2012 Share Posted February 11, 2012 How can i search a bitmap and get a color at a x,y cord ? without displaying the bitmap Quote Link to comment Share on other sites More sharing options...
FHannes Posted February 11, 2012 Share Posted February 11, 2012 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] Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 12, 2012 Author Share Posted February 12, 2012 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? Quote Link to comment Share on other sites More sharing options...
FHannes Posted February 12, 2012 Share Posted February 12, 2012 BitmapFromString((B.X2-B.X1+1),(B.Y2-B.Y1+1), '') You need to use a for-loop with [wiki=TIAContains]TIAContains[/wiki]. Quote Link to comment Share on other sites More sharing options...