随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

//声明:
SetPixel(
  DC: HDC;        {设备环境句柄}
  X, Y: Integer;  {坐标}
  Color: COLORREF {颜色值}
): COLORREF;      {返回颜色值}

SetPixelV(
  DC: HDC;        {设备环境句柄}
  X, Y: Integer;  {坐标}
  Color: COLORREF {颜色值}
): BOOL;

{SetPixel 与 SetPixelV 功能一致, 但返回值不一样; 书上说 SetPixelV 更快.}

//举例: procedure TForm1.FormPaint(Sender: TObject); var c: TColor; x,y: Integer; begin Self.Color := clWhite; c := clRed; x := 1; y := 1; while x < ClientWidth do begin while y < ClientHeight do begin SetPixel(Canvas.Handle, x, y, c); Inc(y,4); end; Inc(x,4); y := 0; end; end;
//效果图:

posted on 2008-02-10 18:44  万一  阅读(...)  评论(...编辑  收藏