コード例 #1
0
ファイル: BitmapFontMx.cs プロジェクト: Gillibald/Typography
        static GlyphImage ReadGlyphImages(string filename)
        {
            PixelFarm.CpuBlit.ActualBitmap bmp = StorageService.Provider.ReadPngBitmap(filename);
            GlyphImage img = new GlyphImage(bmp.Width, bmp.Height);

            img.SetImageBuffer(PixelFarm.CpuBlit.ActualBitmap.GetBuffer(bmp), true);
            return(img);
        }
コード例 #2
0
        static GlyphImage ReadGlyphImages(string filename)
        {
            PixelFarm.CpuBlit.ActualBitmap bmp = StorageService.Provider.ReadPngBitmap(filename);
            GlyphImage img = new GlyphImage(bmp.Width, bmp.Height);

            int[] buffer = new int[bmp.Width * bmp.Height];
            unsafe
            {
                PixelFarm.CpuBlit.Imaging.TempMemPtr tmp = PixelFarm.CpuBlit.ActualBitmap.GetBufferPtr(bmp);
                System.Runtime.InteropServices.Marshal.Copy(tmp.Ptr, buffer, 0, bmp.Width * bmp.Height);
                img.SetImageBuffer(buffer, true);
            }
            return(img);
        }
コード例 #3
0
 public abstract void SavePngBitmap(PixelFarm.CpuBlit.ActualBitmap bmp, string filename);
コード例 #4
0
ファイル: BitmapFontMx.cs プロジェクト: Gillibald/Typography
        static void SaveImgBufferToFile(GlyphImage glyphImg, string filename)
        {
            var bmp = new PixelFarm.CpuBlit.ActualBitmap(glyphImg.Width, glyphImg.Height, glyphImg.GetImageBuffer());

            StorageService.Provider.SavePngBitmap(bmp, filename);
        }