public Operation(UndoRedoBuffer parent, BitmapView view, Model.Bitmap bitmap, int x, int y, int from, int to) : base(parent) { m_View = view; m_Bitmap = bitmap; m_X = x; m_Y = y; m_From = from; m_To = to; }
private void OnPaletteChanged() { m_Bitmap = null; if (m_PaletteView != null) { m_Bitmap = new Model.Bitmap(m_PaletteView.Palette); } Invalidate(); }
public bool addGlyph(char glyph, Model.Bitmap Bitmap) { if (!hasGlyph(glyph)) { Glyphs.Add(glyph, Bitmap); return(hasGlyph(glyph)); } else { return(false); } }
public Model.Bitmap fromSingleLine(string pattern, Model.Dimension Dimension) { Model.Bitmap Bitmap = new Model.Bitmap(Dimension); pattern = clipPattern(pattern, Bitmap.getDimension().height *Bitmap.getDimension().width); int subPartLength = Bitmap.getDimension().width; for (int y = 0; y < Bitmap.getDimension().height; y++) { int start = y * Bitmap.getDimension().width; char[] row = pattern.Substring(start, subPartLength).ToCharArray(); for (int x = 0; x < row.Length; x++) { Bitmap.getPixels().Add(new Model.Pixel(new Point(x, y), row[x])); } } return(Bitmap); }
public override void parseLineTag <T>(ref T Model, System.Text.RegularExpressions.MatchCollection Matches) { List <string> CharValues = new List <string>(); char glyph = ' '; if (!(base.TryGetGroupValues(Matches, "char", ref CharValues) && char.TryParse(CharValues[0], out glyph))) { throw new ArgumentException("cant parse glyph"); } List <string> PattenValues = new List <string>(); if (!base.TryGetGroupValues(Matches, "pattern", ref PattenValues)) { throw new ArgumentException("cant parse pattern"); } else { Model.Bitmap GlyphBitmap = getBitmapFactory().fromSingleLine(PattenValues[0], (Model as Model.Font).getDimension()); (Model as Model.Font).addGlyph(glyph, GlyphBitmap); } }
public void bitmap(Model.Bitmap Bitmap, Model.Canvas Canvas) { multiPoint(Bitmap.getPixels(), Canvas, true); }