示例#1
0
文件: Icon.cs 项目: i-e-b/Form8sn
 // Load the icon contents from a stream, and then set the
 // current frame to the first one in the icon image.
 private void Load(Stream stream)
 {
     image = new PortableImage();
     image.Load(stream);
     frame    = image.GetFrame(0);
     frameNum = 0;
 }
示例#2
0
文件: Icon.cs 项目: i-e-b/Form8sn
        // Select a particular frame from this icon.
        private void SelectFrame(int width, int height)
        {
            int   index;
            Frame frame;

            for (index = 0; index < image.NumFrames; ++index)
            {
                frame = image.GetFrame(index);
                if (frame.Width == width && frame.Height == height)
                {
                    this.frame = frame;
                    frameNum   = index;
                    return;
                }
            }
            frame    = image.GetFrame(0);
            frameNum = 0;
        }
示例#3
0
文件: Icon.cs 项目: i-e-b/Form8sn
 private Icon(Icon cloneFrom)
 {
     if (cloneFrom == null)
     {
         throw new ArgumentNullException("cloneFrom");
     }
     image    = (PortableImage)(cloneFrom.image.Clone());
     frameNum = cloneFrom.frameNum;
     frame    = image.GetFrame(frameNum);
 }