Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   General (http://www.delphipages.com/forum/forumdisplay.php?f=2)
-   -   Dot on screen (http://www.delphipages.com/forum/showthread.php?t=18007)

Goober 01-02-2001 11:27 PM

Dot on screen
 
What is the delphi function for putting a single dot of a colour on the screen?
It needs to use HDC so that I can fit it in with the method I already have for drawing on the canvas of the screen.

Thanks
Goober

PoseFant 01-03-2001 12:01 AM

RE: Dot on screen
 
I'm not sure of what you want to do, but here's something I cut from the help file ...

var
W: Word;
begin
for W := 10 to 200 do
Canvas.Pixels[W, 10] := clRed;

end;


Regards

/Filip

OregonGhost 01-03-2001 02:42 AM

RE: Dot on screen
 
Delphi does not support a Pixel function with a HDC, you have to use the Windows-API-function
COLORREF SetPixel(
HDC hdc, // handle to device context
int X, // x-coordinate of pixel
int Y, // y-coordinate of pixel
COLORREF crColor // pixel color
);
It returns the color that was on the pixel before the call.
Oregon Ghost


All times are GMT. The time now is 07:58 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.