示例#1
0
        public static DDPicture Mirror(string file)
        {
            return(new DDPicture(
                       () =>
            {
                int siHandle = DDPictureLoaderUtils.FileData2SoftImage(DDPictureLoaderUtils.File2FileData(file));
                int w;
                int h;

                DDPictureLoaderUtils.GetSoftImageSize(siHandle, out w, out h);

                {
                    int h2 = DDPictureLoaderUtils.CreateSoftImage(w * 2, h);

                    for (int x = 0; x < w; x++)
                    {
                        for (int y = 0; y < h; y++)
                        {
                            DDPictureLoaderUtils.Dot dot = DDPictureLoaderUtils.GetSoftImageDot(siHandle, x, y);

                            DDPictureLoaderUtils.SetSoftImageDot(h2, x, y, dot);
                            DDPictureLoaderUtils.SetSoftImageDot(h2, w * 2 - 1 - x, y, dot);
                        }
                    }
                    DDPictureLoaderUtils.ReleaseSoftImage(siHandle);
                    siHandle = h2;
                }

                return DDPictureLoaderUtils.GraphicHandle2Info(DDPictureLoaderUtils.SoftImage2GraphicHandle(siHandle));
            },
                       DDPictureLoaderUtils.ReleaseInfo,
                       DDPictureUtils.Add
                       ));
        }