Results 1 to 2 of 2

Thread: using bmp from file for a sprite-image...

  1. #1

    using bmp from file for a sprite-image...

    I recently tried delphyX. Everything i tried worked well except for a sprite with a large image. I made a gif-file with xara3D and i want to use this for an animation of a sprite. I converted it to bmp with all the frames one after the other. The bmp was a bit over 2MB. I couldn't load it in an imagelist, probably because the file was to big. Is it possible to load this file in runtime. Or to change an image in an imagelist with a bmp-file in runtime. So i could put all the images in files (and the exe file would also be smaller).

  2. #2

    using bmp from file for a sprite-image...

    It's possible and I did it a while ago, I'll search through my archive........................................... .............................
    10 minutes later.... Okay found it !

    [pascal]
    With TPictureCollectionItem(DXImageList1.Items.Add()) do
    Begin
    Picture.LoadFromFile('image.bmp');
    Name := 'MyImage';
    End;

    DXImageList1.Items.Restore; // Don't ask me why this is needed, but it is!
    [/pascal]

    I tested it and it works, however I wouldn't advise this, I wrote a tutorial on my website that works with the DXDraw object, but doesn't use the DXImageList. I made a program once that uses a tiled bitmap of over 5 MB and there isn't even a slowdown noticeable, but I'm familiar with the problem that Delphi crashes (or runs very very slow) when you use big bitmaps in the DXImageList!

    Hope this helps!
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL