Delphi DirectX: how to load files to DXImageList???

Started by
1 comment, last by Antheus 16 years, 11 months ago
Hiya Folks, Quick question for you... I have a string array holding the names of many Bmps/Jpegs. I want the user to be able to select which files they want loaded into a DXImageList (I'll just use a simple checkbox group for the selection). Can you tell me how to load/add these files to the DXImageList at runtime please? Much thanks, Jim [Edited by - Jim_U on May 22, 2007 10:00:21 AM]
Advertisement

Ok, so not the quickest question after all!..but I still can't find a way to do this. The program works great if I load files into the imagelist before running it, so it's REALLY bugging me now! Please help!

Jim
From here: http://members.fortunecity.com/flegelsite/

2.1   Loading pictures at runtime // Load a normal raster-image into DXImageList (BMP, DIB etc.)// Picture becomes an item of DXImageListprocedure LoadImage (Filename, NameImage : String; PatWidth, PatHeight : Integer;  Transp : Boolean; TranspColor : TColor);begin DXImageList.Items.Add; with DXImageList.Items[DXImageList.Items.Count-1] do beginPicture.LoadFromFile (FileName);Name := NameImage;PatternWidth := PatWidth;PatternHeight := PatHeight;SkipHeight := 0;SkipWidth := 0;SystemMemory := False;Transparent := Transp;TransparentColor := TranspColor;Restore;  end;end; With this method, I can load about 200 pictures at a time with no problems. More pictures give problems, just because of the limits of myphysical memory J. Loading jpeg-pictures however, always give problems!  Only BMP and DIB pictures work well.


That Restore might be the most important.

Unfortunately, it's been years since I've encountered Delphi, so I can't test it.

This topic is closed to new replies.

Advertisement