Results 1 to 6 of 6

Thread: Get “Assertion Failure” from Tstream save to image data.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by SilverWarior View Post
    What happens if you save that picture into file from the stream itself using SaveToFile method and then loading the image from file? Do you still get the same error?

    Also does SaveImageToStream method moves the stream position to 0 before saving the data or does it just add the image to the end of the stream?

    Similar question for method AddMaterial. Does it automatically moves the stream position to 0 before reading the data?
    Oh
    The position set... i use Seek...
    The error finds in AddMaterial that doesn't move the stream position to 0

    Thank you Silver Warior... this question is SOLVED ...
    I fix the above code to show my error

    Thank you again...

  2. #2
    I'm glad I could be of help.

    Also since you are reusing existing stream it might not be a bad idea to set its size to 0 before storing the data (greyed image) in it the second time. Why?
    If the size of that data is smaller than the size of stream you might end up with new data to be stored on the beggining of the stream and some renmants of old dta at the end of the stream. And this could lead to some unpredicatable behavior of your program which would probably be hard to debug.
    Naturally this completly depends on how method that stores the data into the stream works (does it adjust the size of the stream or does not).

  3. #3
    Quote Originally Posted by SilverWarior View Post
    I'm glad I could be of help.

    Also since you are reusing existing stream it might not be a bad idea to set its size to 0 before storing the data (greyed image) in it the second time. Why?
    If the size of that data is smaller than the size of stream you might end up with new data to be stored on the beggining of the stream and some renmants of old dta at the end of the stream. And this could lead to some unpredicatable behavior of your program which would probably be hard to debug.
    Naturally this completly depends on how method that stores the data into the stream works (does it adjust the size of the stream or does not).
    As you can see from above the stream when ends the works if free and nil completly...
    And yes it is adjust the size after you tell me about the position ...

    Thank you again...

  4. #4
    No problem. I always try to help if I can.

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
  •