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); }
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); }
public abstract void SavePngBitmap(PixelFarm.CpuBlit.ActualBitmap bmp, string filename);
static void SaveImgBufferToFile(GlyphImage glyphImg, string filename) { var bmp = new PixelFarm.CpuBlit.ActualBitmap(glyphImg.Width, glyphImg.Height, glyphImg.GetImageBuffer()); StorageService.Provider.SavePngBitmap(bmp, filename); }