Jump to content
A-man

fastget/setpixel

Recommended Posts

I know I asked almost this exact question a couple weeks ago, but this time it is regarding the new API. The fastsetpixel and fastgetpixel functions don't show up in the intellisense, and I'm not sure what the 'const bmp' is. I looked in the wiki, but it wasn't there yet.

Link to comment
Share on other sites

Heres an example of using the canvas of the bitmap to set / get the color of the pixels really easy

 

[scar]

var

BMP: TSCARBitmap;

begin

BMP := GetClient.CaptureEx(0,0,50,50);

Writeln(BMP.Canvas.Pixels[10, 10]); // Same as Fast get pixel

BMP.Canvas.Pixels[10, 10] := clRed; // Same as Fast set pixel

BMP.Free;

end.

[/scar]

Link to comment
Share on other sites

Heres an example of using the canvas of the bitmap to set / get the color of the pixels really easy

 

[scar]

var

BMP: TSCARBitmap;

begin

BMP := GetClient.CaptureEx(0,0,50,50);

Writeln(BMP.Canvas.Pixels[10, 10]); // Same as Fast get pixel

BMP.Canvas.Pixels[10, 10] := clRed; // Same as Fast set pixel

BMP.Free;

end.

[/scar]

 

Why use the canvas?

 

[scar]

var

BMP: TSCARBitmap;

begin

BMP := GetClient.CaptureEx(0,0,50,50);

try

Writeln(BMP.Pixels[10, 10]); // Same as Fast get pixel

BMP.Pixels[10, 10] := clRed; // Same as Fast set pixel

finally

BMP.Free;

end;

end.

[/scar]

 

The canvas is A LOT slower, the Pixels property of TSCARBitmap is the actual replacement of the FastPixel API...

Edited by Freddy
Link to comment
Share on other sites

Why use the canvas?

 

[scar]

var

BMP: TSCARBitmap;

begin

BMP := GetClient.CaptureEx(0,0,50,50);

try

Writeln(BMP.Pixels[10, 10]); // Same as Fast get pixel

BMP.Pixels[10, 10] := clRed; // Same as Fast set pixel

finally

BMP.Free;

end;

end.

[/scar]

 

The canvas is A LOT slower, the Pixels property of TSCARBitmap is the actual replacement of the FastPixel API...

 

Didnt see the pixels property of the bitmap. Same principle tho.

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