From 5fb32592ed08ca0f45e3bf1dce77c637441f716e Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 14 May 2005 21:59:59 +0000 Subject: Initial Checkin --- BitmapChar.cs | 257 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 BitmapChar.cs (limited to 'BitmapChar.cs') diff --git a/BitmapChar.cs b/BitmapChar.cs new file mode 100644 index 0000000..910a4b2 --- /dev/null +++ b/BitmapChar.cs @@ -0,0 +1,257 @@ +// BitmapFontEd +// Copyright (C) 2005 Ian Cowburn +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// $Id$ +// +using System; +using System.Drawing; +using System.IO; + +namespace BitmapFontEd +{ + /// + /// Description of BitmapChar. + /// + public class BitmapChar + { + public BitmapChar(uint width, uint height) + { + m_width=width; + m_height=height; + m_data=new Color[m_width,m_height]; + } + + public BitmapChar() : this(8,8) + { + } + + public BitmapChar(BitmapChar old) + { + m_width=old.m_width; + m_height=old.m_height; + m_data=new Color[m_width,m_height]; + + for(int x=0;x=0 && nx=0 && ny=0 && nx=0 && ny>8; + } + } + + private static void WriteInt(Stream s, int l) + { + for(uint f=0;f<4;f++) + { + s.WriteByte((byte)(l&0xff)); + l=l>>8; + } + } + } +} -- cgit v1.2.3