Omegaimagelist
TOmegaImageList Properties

Imagelist
A collection of TImagelistItems. They store the pictures and some properties for your grafix.
Name
The name of your imagelist.
Omegascreen
Your Omegascreen the grafix will be drawed to.
Tag
This one is free for your own use and does nothing.

Some methods
omegaimagelist1.ImageList.LoadFromFile('grafix\imagelistman.oil');
ImageListMan.Init;
You must always Init your Imagelist. If you want to load the imagelist from a file,
do it with ".Imagelist.LoadFromFile" before you init the Imagelist.
omegaimagelist1.Begindraw
You must use this before you draw the images to the Omegascreen.
omegaimagelist1.Enddraw
You must use Enddraw after you finished drawing images to the Omegascreen.
omegaimagelist1.ImageList.SaveToFile('grafix\imagelistman.oil');
You can save your Imagelist like this.
TOmegaImageListItem Properties

Name
The name of your Imagelistitem.
Picture
Opens a dialog to choose your image with.
TileHeight
The TileHeight of your image. If you want to use glued images, you have to set the Height
of your Tile here, else just set the Height of the Image here.
TileWidth
The same as TileHeight for the Width of your Image or Tile.
Transparent
If set to True, the Pixels of the Image with the Transparent color will be transparent.
Transparent color
The color that should be transparent.

Some methods
omegaimagelist1.Imagelist.Items[0].Draw(X, Y :integer; rotation : single; RotationCenterX, RotationcenterY: single; ScaleX, ScaleY : single; Red, Green, Blue, Alpha : integer; AlphaBlend: Boolean; Index : integer);
This draws your Imagelistitem directly to the assigned Omegascreen. x and y are the left and top position.
With Rotation you can rotate the Image. RotationCenterX and RotationCenterY are the X and Y coordinates of the Rotation Center, where (0, 0) is the top left corner and (1, 1) is the bottom right corner of your Image/Tile.
With ScaleX and ScaleY you can shrink your image, 0.5 would be half size,
2 would be double size. With Red, Green and Blue you can choose the color of your image, default is 255,255,255.
0,0,0 would be very dark. Alpha is the alpha-Value for the image, 0 would be not transparent, 255 totally transparent.
TileWidth and TileHeight are the TileWidth and Height of your Tile or the Width and Height of your Image.
Imageindex is the number of the Tile to show, if you only use one image, use 0 here.

omegaimagelist1.Imagelist.Items[0].Draw(X, Y :integer; Index: integer);
This is a simplified Draw Procedure. You can use this one if you want to draw the Image without Rotation, Scale and Alpha Blending
omegaimagelist1.Imagelist.Items[0].DrawRect(Rect: TRect; X, Y :integer; rotation : single; RotationCenterX, RotationcenterY: single; ScaleX, ScaleY : single; Red, Green, Blue, Alpha : integer; AlphaBlend: Boolean);
This draws any rectangle of your Image on the Screen. Rect is the rectangle you want to copy relative to the top left corner of the Image (so (0, 0) is the top left corner and (Width, Height) is the bottom right corner).

omegaimagelist1.Imagelist.Items[0].DrawRect(Rect: TRect; X, Y :integer);
This is a simplified DrawRect Procedure. You can use this one if you want to draw the Rect without Rotation, Scale and Alpha Blending
Loading and adding an Image to the Imagelist at runtime
procedure addimage;
var imageitem: timagelistitem;
pic: tpicture;
il: timagelistitem;
begin
pic:=tpicture.Create;
pic.LoadFromFile(fname);
//set properties of the image here
il:=timagelistitem.create(omegaimagelist1.ImageList);
il.name:=fname;
il.SetPicture(pic);
il.TileHeight:=ntilewidth;
il.Tilewidth:=ntileheight;
il.init;
il:=omegaimagelist1.ImageList.Add;
end;

With these procedure you can Create a new Imagelistitem, load it's picture and add that Imagelistitem
to your imagelist

Back to the Index