private void FillPictureEditor(Bitmap btmp, ColorTable workingPalette) { if (comboBoxZoom.SelectedItem == null) comboBoxZoom.SelectedIndex = 0; btmp.ChangeColorTable(workingPalette); clrs.Clear(); foreach (var color in btmp.Colors.Values) { clrs.Add(color); } clrs.Add(new ColorRecord("TRANS", "Transparent", new CIEYxy(1, 1, 1))); colorComboBox1.Items.Clear(); colorComboBox1.Items.AddRange(clrs.ToArray()); colorComboBox1.SelectedIndex = 1; colorComboBox1.Refresh(); string zoom = comboBoxZoom.SelectedItem.ToString(); pictureBoxBitmapEditor.Image = btmp.GetZoomedImage(Convert.ToInt32(zoom.Substring(0, zoom.Length - 1)) / 100, true); pictureBoxBitmapEditor.Width = pictureBoxBitmapEditor.Image.Width + 1; pictureBoxBitmapEditor.Height = pictureBoxBitmapEditor.Image.Height + 1; }
public void SaveSymbolToFile(string fileName, Symbol symbol) { TextWriter tw = new StreamWriter(fileName, false); tw.Write(symbol.ToString()); tw.Close(); }
private void SetImage(Bitmap btmp) { btmp.ChangeColorTable(parser.ColorTables[comboBoxBitmapColorTables.SelectedItem.ToString()]); FillPictureEditor(btmp, parser.ColorTables[comboBoxBitmapColorTables.SelectedItem.ToString()]); pictureBoxBitmapView.Image = btmp.Image; }
public void ExportSymbolToBitmap(string fileName, Symbol symbol, ImageFormat imageFormat) { if (this.IsBitmap(symbol.ToString())) { symbol.GetZoomedImage(1, false).Save(fileName, imageFormat); } else { symbol.GetVectorRendering(DefaultColorTable).Save(fileName, imageFormat); } }