Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Save modified DXImageList items

  1. #1

    Save modified DXImageList items

    Hi,

    When I draw something in a DXImageList item, and then save the list to a file it don't save it with the changes... for example:

    [pascal]
    // Open a list
    DXImageList.Items.LoadFromFile('mylist1.dxg');

    // Drawing something to the first image
    AnotherList.Items[0].DrawAlpha(DXImageList.Items[0].PatternSurfaces[0],Bounds(0,0,100,100),0,64);

    // And finally save the list
    DXImageList.Items.SaveToFile('mylist2.dxg');
    [/pascal]


    The mylist2.dxg remains equal to mylist1.dxg, it don't save the changes...

    Please anybody could help me with it?

    Thanx in advance.

    Regards,
    Floken

  2. #2

    Save modified DXImageList items

    Please can anyone help me with this?

    I made a program to create animated sprites, it fully works, but it can't save the changes

    Why the modified items (after drawing in them) in the DXImageList don't save right?

    I'm using PatternSurface to draw into the image, is that the problem? How I can draw to it in other way?

    Too many questions, looking for little simple answer

    Thanx, hope anybody could help me.

    Regards,
    Floken

  3. #3

    Save modified DXImageList items

    I believe you have to use assign, but I'm not quite sure how.
    Not much of a help, I know, sorry ops:

    An other idea perhaps is to save each frame to a seperate file and load them in the imagelist manually

  4. #4

    Save modified DXImageList items

    I've tried to save separated items but withou success...

    I think the problem is when you draw to a PatternSurface (any surface?) in the item it don't make it permanent... don't know how to explain, but after drawing if I call the method Restore it back to the original image. What I need is the opposite of Restore, something like "FixChanges" or whatever.

    I've tried several "assigns" methods but without success too

    Thx anyway

    Please anybody could help me? The program is almost done, without saving

    Regards,
    Floken

  5. #5
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Save modified DXImageList items

    Send your program to me and I'll have a look. Zip the source and send it to william@iafrica.com
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  6. #6

    Save modified DXImageList items

    I've send you an example of the code I'm using, hope you could help.

    Everyone who wants to try it, I've made it available at http://www.floken.com/tmp/Example.zip

    Instructions:

    first run the executable...

    1. Draw something with the mouse.

    2. Click the save button to save DXImageList2.Items to a file named "test.dxg"

    3. Click the "New" button, so it clears the DXImageList2 contents...

    4. Then, click the "Open" button to load "test.dxg" into DXImageList2


    The problem is it don't save to the file the drawings made with the mouse.

    Hope you could help, thanx a lot !!

    Note: english is not my native language, hope you understand what I mean

    Regards,
    Floken

  7. #7
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Save modified DXImageList items

    I can simulate exactly your problem. I think it may have something to do with locking/unlocking the surface but I havn't got it right yet.

    Also it could be that a picturecollectionitem only has a pattern surface on which to draw instead of on the actual surface.

    I'm still trying to find a solution
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  8. #8

    Save modified DXImageList items

    Thank you very much for trying, hope you could find a solution... I spent lots of hours with this project, but it will be useless without saving...

    I've made it before using GR32 components, but I really want to use DelphiX because DX is a lot faster.

    Thanx again, I'll be waiting and hoping you don't give up

    Best Regards,
    Floken

  9. #9
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Save modified DXImageList items

    I havn't had another chance to look at this yet

    I can think of a tenmporary solution but it may not quite be what you are looking for. Save the image to a bitmap (there is a thread from me in the DelphiX section on screen dumps that will show you how) - then load it back into the DXImageList.

    I will still look into this sometime but I just dont have time at the moment
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  10. #10

    Save modified DXImageList items

    Well, probably I'll use that method temporarly, but it's not appropriate using it in the final project.

    Anyway, thanks for trying to help me with this issue.

    Regards,
    Floken

    www.floken.com

Page 1 of 2 12 LastLast

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
  •