Changeset 450 for GraphicTest/UFastBitmap.pas
- Timestamp:
- Nov 23, 2012, 1:11:03 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UFastBitmap.pas
r442 r450 38 38 constructor Create; 39 39 destructor Destroy; override; 40 procedure RandomImage ;40 procedure RandomImage(Index, Count: Integer); 41 41 property Size: TPoint read FSize write SetSize; 42 42 property Pixels[X, Y: Integer]: TFastBitmapPixel read GetPixel write SetPixel; … … 204 204 end; 205 205 206 procedure TFastBitmap.RandomImage ;206 procedure TFastBitmap.RandomImage(Index, Count: Integer); 207 207 var 208 208 I, X, Y: Integer; 209 209 begin 210 // Main three color blocks 210 211 for I := 0 to 2 do 211 for Y := 0 to (Size.Y div 2) - 1 do212 for Y := 0 to (Size.Y div 3) - 1 do 212 213 for X := 0 to (Size.X div 3) - 1 do 213 214 Pixels[X + (I * (Size.X div 3)), Y] := (255 shl (I * 8)) and $ffffff; 214 215 215 for Y := (Size.Y div 2) to Size.Y - 1 do 216 // Random noise 217 for Y := (Size.Y div 3) to (Size.Y * 2 div 3) - 1 do 216 218 for X := 0 to Size.X - 1 do 217 219 Pixels[X, Y] := (Random(256) or (Random(256) shl 16) or (Random(256) shl 8)) and $ffffff; 220 221 // Color gradient 222 for Y := (Size.Y * 2 div 3) to (Size.Y - 1) do begin 223 for X := 0 to Size.X - 1 do 224 Pixels[X, Y] := (Trunc(Sin((X + Trunc(Index / Count * Size.X)) mod Size.X 225 / Size.X * pi) * 255) * $010101) and $ffffff; 226 end; 218 227 end; 219 228
Note:
See TracChangeset
for help on using the changeset viewer.