Why GifBitmapDecoder play incomplete gif

前端 未结 1 1836
予麋鹿
予麋鹿 2021-01-29 03:45

I want to play a gif image using GifBitmapDecoder and Int32Animation, but I found some gif is incomplete when they were played.

Here is my gif:

1条回答
  •  走了就别回头了
    2021-01-29 04:10

    Individual GIF frames might be just portions of an image at any arbitrary X,Y-coordinate.

    For properly placing a frame in the image, you will need the X,Y-coordinate of the frame. Read this post about how to get this information: Reading Metadata property of GifBitmapDecoder...why is it null?

    Then to get a complete image you must merge the frame with the previous frame(s), until a complete image is being obtained. However, assuming that your real "GIF player" just draws the animation frames one on top of another (instead of putting them side-by-side in a StackPanel), this would happen automagically...

    0 讨论(0)
提交回复
热议问题