Search

Sunday, July 30, 2006

Frame Arrangement in image strips used for animation

Cross posted from http://blogs.msdn.com/abhinaba/archive/2005/08/16/452080.aspx

Sometimes we get so used to things being the way they are we stop questioning them. We always have the perception in mind that individual frames of animated logo in a Bitmap strip is always horizontally arranged. I remember writing code to extract icons from a image lists that store individual frames of an animation sequence one after the other horizontally using something like


animationIcons = new Icon[bitmapStrip.Width / 16];
for (int
i = 0; i < m_animationIcons.Length; i++)
{
Rectangle rect =
new
Rectangle(i*16, 0, 16, 16);
Bitmap bmp = bitmapStrip.Clone(rect, bitmapStrip.PixelFormat);
animationIcons[i] = Icon.FromHandle(bmp.GetHicon());
}


Even winforms ImageList works on this assumption that the AddStrip method of the ImageCollection in the control has the images placed side-by-side. However this is not at all the optimal placement of images. Read it on Raymond Chen's blog .....

No comments: