PDA

View Full Version : TDXImageList *.jpg Support?



tronied
18-03-2003, 06:05 PM
Since I am trying to economise on space with my project I have decided to stop using *.bmp files and convert over to *.jpg. However, when I use the following :

for ItemCounter := 0 to ImagePreLoad.Items.Count -1 do
begin
//Load the Images Into the DXImageList Component
GameTiles.Items.Add;
GameTiles.Items[ItemCounter].Picture.LoadFromFile(
ExtractFilePath(Application.ExeName)+'Images\'+
ImagePreLoad.Items[ItemCounter]);
end;

GameTiles = TDXImageList
ImagePreLoad = TFileListBox

Basically, when I create an item (TPictureCollection) manually and load an image into it, the format for *.jpg is there... However, when I try and do the above and load it I get "Unknown Picture File Extension `.jpg`". I have also tried

GameTiles.Items[ItemCounter].Picture.Graphic.LoadFromFile();

However, this also does not work and gives me an Access Violation error. Any ideas?

Useless Hacker
19-03-2003, 12:03 PM
Make sure you have added 'JPEG' to your uses clause...

tronied
19-03-2003, 01:11 PM
JPEG into my uses clause? Havent heard of that one before... but Great! Thankyou... I will try it tonight when I get back. :D