有没有办法创建一个在点击或点击时翻转到另一侧(另一页)的图像?

时间:2021-01-26 04:50:38

标签: image gif animated-gif

用户有一张双面的名片。它的正面是主要信息,背面是次要细节。她希望当她将名片发送给她的联系人时,他们应该只看到它的正面。单击它后,它应该翻转到另一侧。图像应该是 gif 或任何其他独立于任何程序的图像格式。

我所能想到的就是创建一个 gif,它在一段时间后会更改为另一侧,这不满足她仅在单击时更改的要求。

我想到了带有热点的 ImageMap,但这也需要链接网络上的另一侧(页面),这违背了图像的独立性。

非常感谢在这方面的任何帮助。

1 个答案:

答案 0 :(得分:1)

GIF89a standard(我们今天使用的那个)包含专门为此设计的所谓的 User Input 标志。
该标志设置在某个帧上,应该告诉 GIF 解码器在超时到期用户与当前帧交互之前不要显示下一帧。
零超时加上非零 User Input 意味着解码器应该无限期地等待交互。

引用标准:

        v) User Input Flag - Indicates whether or not user input is
        expected before continuing. If the flag is set, processing will
        continue when user input is entered. The nature of the User input
        is determined by the application (Carriage Return, Mouse Button
        Click, etc.).

        Values :    0 -   User input is not expected.
                    1 -   User input is expected.

        When a Delay Time is used and the User Input Flag is set,
        processing will continue when user input is received or when the
        delay time expires, whichever occurs first.

不幸的是,我所知道的任何 GIF 解码器都懒得正确处理这个标志——所以我猜你最好的办法是给两帧合理的超时时间,10±5 秒左右。

相关问题