- 4.51.2.4.55. -
Table of Contents
4. Standard Units
4.51. ObjGfx40 - ObjectGraphics 4.0 Unit
4.51.2. ObjGfx40 Unit Object Types
4.51.2.4. ogSurface object
4.51.2.4.55. ogSetPixelRGBA()
4.51.2.4.55. ogSetPixelRGBA()
Targets: MS-DOS, Win32 console
ObjGfx40 Unit
Draws a pixel.
Declaration:
procedure ogSetPixelRGBA(x, y:int32; r, g, b, a:uInt8); virtual;
Remarks:
Draws a pixel at x,y in using the colour components to build the pixel. If blending
is enabled in the surface then the alpha channel will dictate the significance of the source
pixel.
See also:
Sample code:
{ogSetPixelRGBA.pas}
uses
ObjGfx40, CRT;
begin
randomize;
if not screen^.ogCreate(640, 480, OG_PIXFMT_32BPP) then
begin
writeln('Error setting video mode');
halt
end;
screen^.ogSetBlending(TRUE);
repeat
with screen^ do
ogSetPixelRGBA(random(ogGetMaxX), random(ogGetMaxY), random(255), random(255), random(255), random(255));
until keyPressed;
readkey;
end.
- 4.51.2.4.55. -