从精灵中绘制动画图像? [英] Drawing an animated image from a sprite?

查看:101
本文介绍了从精灵中绘制动画图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢在资源编辑器中浏览Windows文件,只是为了看看那里有什么。我注意到很多精灵图像实际上是动画。例如,文件32x256具有8个图块,每个图块32x32彼此相邻。我假设程序获取每个图块并按顺序显示它们,我只是想知道如何自己做。我有一个精灵,当我连接到数据库时,我想用它作为加载动画。谷歌一无所获。任何人都可以帮帮我吗?

I like to go through the Windows files in a resource editor, just to see what''s there. I notice a lot of sprite images that are actually animations. For example, a file 32x256 has 8 tiles each 32x32 right next to each other. I assume that the program gets each of thoe tiles and displays them in sequence, I just want to know how to do it myself. I have a sprite that I''d like to use as a loading animation while I''m connecting to a database. Google is turning up nothing. Can anyone help me out?

推荐答案

我不确定。如果我不得不采取刺,我会使用计时器来更改我正在显示的图块,然后显示相应的框架。当我在QBasic中编写图形内容时,我曾经做过这种事情,但是我不确定你是怎么用C#做的。


也许你可以浏览图像的内存并将其放入Image类,然后将这些图像放入List< Image>宾语。然后你可以使用你的计时器来显示合适的图像。


我觉得有更好的方法,甚至是.NET内置的东西,我只是不喜欢我知道它是什么:)
I''m not sure. If I had to take a stab at it, I''d use a timer to change the tile I was displaying and then display the appropriate frame. I used to do this kind of thing way back when I programmed graphics stuff in QBasic, but I''m not sure how you''d do it in C#.

Maybe you can run through the image''s memory and put it into an Image class, then put those images into a List<Image> object. Then you can use your timer to display the appropriate image.

I feel like there''s a better way of doing this, or even something built into .NET, I just don''t know what it is :)


我会看别人给我一些建议。有人必须知道如何做到这一点。在C ++中是不可能的,而不是在C#中(windows是用C ++编写的,还是C?)
I''ll wat for someone else to give me some advice on this. Someone has to know how to do it. It can''t be possible in C++ and not in C# (windows is programmed in C++ right, or is it C?)


如果他们不是,那就不是太难了。我会承认自己很感兴趣...经过短途旅行(通过谷歌)到一个有经典视频游戏的恶搞表格的网站后,我自己制作了一个正在运行的超级男人动画(来自Mega Man X,哇!)。 />

这很容易实现,虽然我确实使用了Bitmap类(而不是Image类),所以它没有做透明度。唯一的原因是,我不想弄清楚图像是如何存储在内存中的;)


所以,你去了,你有一个后备......手动操作非常简单。虽然出于好奇,你提到C ++中有一些东西可以做到。那是什么?
If they don''t, it''s not terribly hard. I''ll admit to being intrigued... after a short trip (via Google) to a site with spite sheets from classic video games, I built myself a running mega man animation (from Mega Man X, whoo!).

It was pretty easy to implement, though I did use the Bitmap class (instead of the Image class) so it doesn''t do transparency. The only reason for that though is that I didn''t want to figure out how the image was stored in memory ;)

So you there you go, you''ve got a fallback... it''s pretty easy to do manually. Though out of curiosity, you mentioned there''s something in C++ that does it. What is that?


这篇关于从精灵中绘制动画图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆