using System.Drawing; using System.Windows.Forms; namespace FontConv { /* * character preview */ public partial class CharPreview : UserControl { /* * bitmap */ private Bitmap _bitmap; /* * constants */ public const int PixelSize=8; /* * constructor */ public CharPreview() { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer,true); } /* * create from the given character */ public void Create(char c_,int xoffset_,int yoffset_,int extraLines_) { bool[,] values; int x,y; Point pos; Point[] line; values=FontUtil.GetCharacterBitmap(this,this.Font,c_,xoffset_,yoffset_,extraLines_); _bitmap=new Bitmap(values.GetLength(0)*PixelSize,values.GetLength(1)*PixelSize); pos=Point.Empty; using(Graphics g=Graphics.FromImage(_bitmap)) { g.FillRectangle(Brushes.White,0,0,_bitmap.Width,_bitmap.Height); for(y=0;y