Beispiel #1
0
        public bool SaveAsBMA(string path)
        {
            if (path == "")
            {
                return(false);
            }
            bitmap = new Bitmap(1, 8);
            GetBitmap();
            int frames = ActiveFrame.Width;

            ActiveFrameX  = 0.0;
            ActiveFrame.X = 0;
            int x = 0;

            AnimationConverter animationConverter = new AnimationConverter(TextArea.Width, TextArea.Height);

            while (frames > 0)
            {
                GetBitmap();
                if (x != ActiveFrame.X)
                {
                    x = ActiveFrame.X;
                    frames--;
                }
            }
            frames = SpaceWidth + TextSize.Width + 1;
            while (frames > 0)
            {
                animationConverter.AddFrame(GetBitmap());
                if (x != ActiveFrame.X)
                {
                    x = ActiveFrame.X;
                    frames--;
                }
            }
            if (animationConverter.Encode(path, 0, animationConverter.animation.FramesCount - 1, AnimationConverter.ColorOrder.RGB, AnimationConverter.PixelOrder.VS_TR, AnimationConverter.DataType.Default))
            {
                SetLBResourcePath(path);
                return(true);
            }
            return(false);
        }