Janilabo

Untitled

Oct 25th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.07 KB | None | 0 0
  1. procedure DrawMatrixBitmap(bitmap: Integer; matrix: T2DIntegerArray);
  2. var
  3.   x, y, w, h: Integer;
  4. begin
  5.   h := High(matrix);
  6.   for x := 0 to h do
  7.   begin
  8.     w := High(matrix[y]);
  9.     for y := 0 to w do
  10.       FastSetPixel(bitmap, x, y, matrix[x][y]);
  11.   end;
  12. end;
  13.  
  14. procedure DebugBitmap(bmp: Integer);
  15. var
  16.   w, h: Integer;
  17. begin
  18.   GetBitmapSize(bmp, w, h);
  19.   DisplayDebugImgWindow(w, h);
  20.   DrawBitmapDebugImg(bmp);
  21. end;
  22.  
  23. var
  24.   colors: T2DIntegerArray;
  25.   bmp, X, Y: Integer;
  26.  
  27. begin
  28.   SetLength(colors, 6);
  29.   X := 16777215;
  30.   Y := 0;
  31.   colors[0] := [Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y];
  32.   colors[1] := [Y, Y, Y, X, Y, X, X, X, Y, X, Y, Y, X, Y, X, Y];
  33.   colors[2] := [Y, Y, Y, X, Y, X, Y, X, Y, X, X, Y, X, Y, X, Y];
  34.   colors[3] := [Y, Y, Y, X, Y, X, X, X, Y, X, Y, X, X, Y, X, Y];
  35.   colors[4] := [Y, X, X, X, Y, X, Y, X, Y, X, Y, Y, X, Y, X, Y];
  36.   colors[5] := [Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y];
  37.   bmp := CreateBitmap(Length(colors[0]), Length(colors));
  38.   DrawMatrixBitmap(bmp, colors);
  39.   DebugBitmap(bmp);
  40.   FreeBitmap(bmp);
  41. end.
Advertisement
Add Comment
Please, Sign In to add comment