diff --git a/.gitignore b/.gitignore
index a11f506..f635fe4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,8 @@
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+examples/tests/32x32/
+
# User-specific files
*.rsuser
*.suo
diff --git a/McBitFont/Form1.Designer.cs b/McBitFont/Form1.Designer.cs
index 753479c..180d8a9 100644
--- a/McBitFont/Form1.Designer.cs
+++ b/McBitFont/Form1.Designer.cs
@@ -95,6 +95,7 @@
toolTip1 = new System.Windows.Forms.ToolTip(components);
chkLeftSide = new System.Windows.Forms.CheckBox();
chkTopSide = new System.Windows.Forms.CheckBox();
+ importImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)nudX).BeginInit();
((System.ComponentModel.ISupportInitialize)nudY).BeginInit();
panel1.SuspendLayout();
@@ -363,7 +364,7 @@
//
cmMinilist.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { tsmiMakeVarWidth, tsmiPrepensSymbol, tsmiAppendSymbol, tsmiRemoveSymbol, tsmiRemoveBefore, tsmiRemoveAfter, tsmiCodeShift });
cmMinilist.Name = "cmMinilist";
- cmMinilist.Size = new System.Drawing.Size(216, 180);
+ cmMinilist.Size = new System.Drawing.Size(216, 158);
//
// tsmiMakeVarWidth
//
@@ -495,7 +496,7 @@
//
// fileToolStripMenuItem
//
- fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, exportToolStripMenuItem, exitToolStripMenuItem });
+ fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, importImageToolStripMenuItem, exportToolStripMenuItem, exitToolStripMenuItem });
fileToolStripMenuItem.Name = "fileToolStripMenuItem";
fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
fileToolStripMenuItem.Text = "File";
@@ -864,6 +865,14 @@
toolTip1.SetToolTip(chkTopSide, "Height changes will be made on Top/Bottom side");
chkTopSide.UseVisualStyleBackColor = true;
//
+ // importImageToolStripMenuItem
+ //
+ importImageToolStripMenuItem.Image = Properties.Resources.z_folder_image;
+ importImageToolStripMenuItem.Name = "importImageToolStripMenuItem";
+ importImageToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
+ importImageToolStripMenuItem.Text = "Import image";
+ importImageToolStripMenuItem.Click += importImageToolStripMenuItem_Click;
+ //
// MainForm
//
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@@ -980,6 +989,7 @@
private System.Windows.Forms.ToolStripMenuItem tsmiAppendSymbol;
private System.Windows.Forms.ToolStripMenuItem tsmiCodeShift;
private System.Windows.Forms.ToolStripMenuItem tsmiMakeVarWidth;
+ private System.Windows.Forms.ToolStripMenuItem importImageToolStripMenuItem;
}
}
diff --git a/McBitFont/Form1.cs b/McBitFont/Form1.cs
index 86d69ac..efceba7 100644
--- a/McBitFont/Form1.cs
+++ b/McBitFont/Form1.cs
@@ -471,7 +471,7 @@ namespace McBitFont {
private void button1_Click(object sender, EventArgs e) {
if (modified) {
if (MessageBox.Show("Current symbol is modified.\nDo you want to save the changes?", "Symbol was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
- saveFrame();
+ SaveFrame();
} else {
f = CopyFrame(frames.Find(x => x.code == f.code));
}
@@ -484,10 +484,10 @@ namespace McBitFont {
}
private void button2_Click(object sender, EventArgs e) {
- saveFrame();
+ SaveFrame();
}
- private void saveFrame() {
+ private void SaveFrame() {
int index = frames.FindIndex(x => x.code == f.code);
frames[index] = f;
@@ -852,7 +852,7 @@ namespace McBitFont {
if (frames.First().code > 0) {
prependSymbolToolStripMenuItem.Enabled = true;
tsmiPrepensSymbol.Enabled = true;
- }else {
+ } else {
prependSymbolToolStripMenuItem.Enabled = false;
tsmiPrepensSymbol.Enabled = false;
}
@@ -908,7 +908,7 @@ namespace McBitFont {
private void checkModifiedFrame() {
if (modified) {
if (MessageBox.Show("Current symbol is modified.\nDo you want to save the changes?", "Symbol was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
- saveFrame();
+ SaveFrame();
}
modified = false;
}
@@ -1050,5 +1050,21 @@ namespace McBitFont {
prjModified = true;
}
+
+ private void importImageToolStripMenuItem_Click(object sender, EventArgs e) {
+ ImageImporter iform = new ImageImporter(f.width, f.height);
+ if (iform.ShowDialog() == DialogResult.OK) {
+ history.AddPre(f);
+ for (int i = 0; i < iform.bmpScaled.Width; i++) {
+ for (int j = 0; j < iform.bmpScaled.Height; j++) {
+ f.data[i,j] = iform.bmpScaled.GetPixel(i, j).ToArgb().Equals(Color.Black.ToArgb());
+ }
+ }
+ history.AddPost(f);
+ dotPanel.Refresh();
+ modified = true;
+ }
+ iform.Dispose();
+ }
}
}
diff --git a/McBitFont/ImageImporter.Designer.cs b/McBitFont/ImageImporter.Designer.cs
new file mode 100644
index 0000000..17477ed
--- /dev/null
+++ b/McBitFont/ImageImporter.Designer.cs
@@ -0,0 +1,418 @@
+namespace McBitFont {
+ partial class ImageImporter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ components = new System.ComponentModel.Container();
+ btnOK = new System.Windows.Forms.Button();
+ btnCancel = new System.Windows.Forms.Button();
+ pbOriginal = new System.Windows.Forms.PictureBox();
+ pbProcessed = new System.Windows.Forms.PictureBox();
+ btnLoadImage = new System.Windows.Forms.Button();
+ dlgLoadImage = new System.Windows.Forms.OpenFileDialog();
+ pbScaled = new System.Windows.Forms.PictureBox();
+ btnConvert = new System.Windows.Forms.Button();
+ tbPixelization = new System.Windows.Forms.TrackBar();
+ lblPixelization = new System.Windows.Forms.Label();
+ lblThreshold = new System.Windows.Forms.Label();
+ tbThreshold = new System.Windows.Forms.TrackBar();
+ lblWhite = new System.Windows.Forms.Label();
+ lblBlack = new System.Windows.Forms.Label();
+ btnResize = new System.Windows.Forms.Button();
+ lblOrigSize = new System.Windows.Forms.Label();
+ lblProcessedSize = new System.Windows.Forms.Label();
+ lblScaledSize = new System.Windows.Forms.Label();
+ label1 = new System.Windows.Forms.Label();
+ label2 = new System.Windows.Forms.Label();
+ label3 = new System.Windows.Forms.Label();
+ label4 = new System.Windows.Forms.Label();
+ lblTransparency = new System.Windows.Forms.Label();
+ tbTransparency = new System.Windows.Forms.TrackBar();
+ toolTip1 = new System.Windows.Forms.ToolTip(components);
+ label5 = new System.Windows.Forms.Label();
+ label6 = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)pbOriginal).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)pbProcessed).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)pbScaled).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)tbPixelization).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)tbThreshold).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)tbTransparency).BeginInit();
+ SuspendLayout();
+ //
+ // btnOK
+ //
+ btnOK.Enabled = false;
+ btnOK.Location = new System.Drawing.Point(171, 345);
+ btnOK.Name = "btnOK";
+ btnOK.Size = new System.Drawing.Size(88, 27);
+ btnOK.TabIndex = 0;
+ btnOK.Text = "OK";
+ btnOK.UseVisualStyleBackColor = true;
+ btnOK.Click += btnOK_Click;
+ //
+ // btnCancel
+ //
+ btnCancel.Location = new System.Drawing.Point(377, 345);
+ btnCancel.Name = "btnCancel";
+ btnCancel.Size = new System.Drawing.Size(88, 27);
+ btnCancel.TabIndex = 1;
+ btnCancel.Text = "Cancel";
+ btnCancel.UseVisualStyleBackColor = true;
+ btnCancel.Click += btnCancel_Click;
+ //
+ // pbOriginal
+ //
+ pbOriginal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ pbOriginal.Location = new System.Drawing.Point(12, 27);
+ pbOriginal.Name = "pbOriginal";
+ pbOriginal.Size = new System.Drawing.Size(200, 200);
+ pbOriginal.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ pbOriginal.TabIndex = 2;
+ pbOriginal.TabStop = false;
+ //
+ // pbProcessed
+ //
+ pbProcessed.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ pbProcessed.Location = new System.Drawing.Point(218, 27);
+ pbProcessed.Name = "pbProcessed";
+ pbProcessed.Size = new System.Drawing.Size(200, 200);
+ pbProcessed.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ pbProcessed.TabIndex = 3;
+ pbProcessed.TabStop = false;
+ //
+ // btnLoadImage
+ //
+ btnLoadImage.Image = Properties.Resources.folder_open;
+ btnLoadImage.Location = new System.Drawing.Point(57, 233);
+ btnLoadImage.Name = "btnLoadImage";
+ btnLoadImage.Size = new System.Drawing.Size(110, 27);
+ btnLoadImage.TabIndex = 4;
+ btnLoadImage.Text = " Load Image";
+ btnLoadImage.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+ btnLoadImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ btnLoadImage.UseVisualStyleBackColor = true;
+ btnLoadImage.Click += btnLoadImage_Click;
+ //
+ // dlgLoadImage
+ //
+ dlgLoadImage.AddExtension = false;
+ dlgLoadImage.Filter = "Images|*.bmp;*.png;*.gif;*.jpg;*.jpeg|All files|*.*";
+ dlgLoadImage.ShowPreview = true;
+ //
+ // pbScaled
+ //
+ pbScaled.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ pbScaled.Location = new System.Drawing.Point(424, 27);
+ pbScaled.Name = "pbScaled";
+ pbScaled.Size = new System.Drawing.Size(200, 200);
+ pbScaled.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ pbScaled.TabIndex = 5;
+ pbScaled.TabStop = false;
+ //
+ // btnConvert
+ //
+ btnConvert.Enabled = false;
+ btnConvert.Image = Properties.Resources.calculator;
+ btnConvert.Location = new System.Drawing.Point(263, 233);
+ btnConvert.Name = "btnConvert";
+ btnConvert.Size = new System.Drawing.Size(110, 27);
+ btnConvert.TabIndex = 6;
+ btnConvert.Text = " Convert";
+ btnConvert.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+ btnConvert.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ btnConvert.UseVisualStyleBackColor = true;
+ btnConvert.Click += btnConvert_Click;
+ //
+ // tbPixelization
+ //
+ tbPixelization.AutoSize = false;
+ tbPixelization.Cursor = System.Windows.Forms.Cursors.SizeWE;
+ tbPixelization.LargeChange = 2;
+ tbPixelization.Location = new System.Drawing.Point(39, 296);
+ tbPixelization.Maximum = 25;
+ tbPixelization.Minimum = 1;
+ tbPixelization.Name = "tbPixelization";
+ tbPixelization.Size = new System.Drawing.Size(128, 32);
+ tbPixelization.TabIndex = 7;
+ tbPixelization.Value = 1;
+ tbPixelization.ValueChanged += tbPixelization_ValueChanged;
+ tbPixelization.KeyDown += tbPixelization_KeyDown;
+ //
+ // lblPixelization
+ //
+ lblPixelization.Location = new System.Drawing.Point(39, 323);
+ lblPixelization.Name = "lblPixelization";
+ lblPixelization.Size = new System.Drawing.Size(128, 15);
+ lblPixelization.TabIndex = 8;
+ lblPixelization.Text = "Pixelization: 1";
+ lblPixelization.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // lblThreshold
+ //
+ lblThreshold.Location = new System.Drawing.Point(263, 323);
+ lblThreshold.Name = "lblThreshold";
+ lblThreshold.Size = new System.Drawing.Size(110, 15);
+ lblThreshold.TabIndex = 10;
+ lblThreshold.Text = "Threshold: 0";
+ lblThreshold.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // tbThreshold
+ //
+ tbThreshold.AutoSize = false;
+ tbThreshold.Cursor = System.Windows.Forms.Cursors.SizeWE;
+ tbThreshold.LargeChange = 10;
+ tbThreshold.Location = new System.Drawing.Point(254, 296);
+ tbThreshold.Maximum = 127;
+ tbThreshold.Minimum = -128;
+ tbThreshold.Name = "tbThreshold";
+ tbThreshold.Size = new System.Drawing.Size(128, 32);
+ tbThreshold.TabIndex = 9;
+ tbThreshold.TickFrequency = 8;
+ tbThreshold.ValueChanged += tbThreshold_ValueChanged;
+ tbThreshold.KeyDown += tbThreshold_KeyDown;
+ //
+ // lblWhite
+ //
+ lblWhite.AutoSize = true;
+ lblWhite.Location = new System.Drawing.Point(221, 282);
+ lblWhite.Name = "lblWhite";
+ lblWhite.Size = new System.Drawing.Size(67, 15);
+ lblWhite.TabIndex = 11;
+ lblWhite.Text = "More white";
+ lblWhite.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // lblBlack
+ //
+ lblBlack.AutoSize = true;
+ lblBlack.Location = new System.Drawing.Point(349, 282);
+ lblBlack.Name = "lblBlack";
+ lblBlack.Size = new System.Drawing.Size(66, 15);
+ lblBlack.TabIndex = 12;
+ lblBlack.Text = "More black";
+ //
+ // btnResize
+ //
+ btnResize.Enabled = false;
+ btnResize.Image = Properties.Resources.arrow_inout;
+ btnResize.Location = new System.Drawing.Point(464, 233);
+ btnResize.Name = "btnResize";
+ btnResize.Size = new System.Drawing.Size(120, 27);
+ btnResize.TabIndex = 13;
+ btnResize.Text = " Resize to frame";
+ btnResize.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+ btnResize.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ btnResize.UseVisualStyleBackColor = true;
+ btnResize.Click += btnResize_Click;
+ //
+ // lblOrigSize
+ //
+ lblOrigSize.AutoSize = true;
+ lblOrigSize.Location = new System.Drawing.Point(12, 9);
+ lblOrigSize.Name = "lblOrigSize";
+ lblOrigSize.Size = new System.Drawing.Size(30, 15);
+ lblOrigSize.TabIndex = 14;
+ lblOrigSize.Text = "0 x 0";
+ //
+ // lblProcessedSize
+ //
+ lblProcessedSize.AutoSize = true;
+ lblProcessedSize.Location = new System.Drawing.Point(218, 9);
+ lblProcessedSize.Name = "lblProcessedSize";
+ lblProcessedSize.Size = new System.Drawing.Size(30, 15);
+ lblProcessedSize.TabIndex = 15;
+ lblProcessedSize.Text = "0 x 0";
+ //
+ // lblScaledSize
+ //
+ lblScaledSize.AutoSize = true;
+ lblScaledSize.Location = new System.Drawing.Point(424, 9);
+ lblScaledSize.Name = "lblScaledSize";
+ lblScaledSize.Size = new System.Drawing.Size(30, 15);
+ lblScaledSize.TabIndex = 16;
+ lblScaledSize.Text = "0 x 0";
+ //
+ // label1
+ //
+ label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ label1.Location = new System.Drawing.Point(6, 279);
+ label1.Name = "label1";
+ label1.Size = new System.Drawing.Size(209, 2);
+ label1.TabIndex = 17;
+ //
+ // label2
+ //
+ label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ label2.Location = new System.Drawing.Point(421, 279);
+ label2.Name = "label2";
+ label2.Size = new System.Drawing.Size(209, 2);
+ label2.TabIndex = 18;
+ //
+ // label3
+ //
+ label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ label3.Location = new System.Drawing.Point(421, 230);
+ label3.Name = "label3";
+ label3.Size = new System.Drawing.Size(2, 51);
+ label3.TabIndex = 19;
+ //
+ // label4
+ //
+ label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ label4.Location = new System.Drawing.Point(215, 230);
+ label4.Name = "label4";
+ label4.Size = new System.Drawing.Size(2, 51);
+ label4.TabIndex = 20;
+ //
+ // lblTransparency
+ //
+ lblTransparency.Location = new System.Drawing.Point(457, 323);
+ lblTransparency.Name = "lblTransparency";
+ lblTransparency.Size = new System.Drawing.Size(144, 15);
+ lblTransparency.TabIndex = 22;
+ lblTransparency.Text = "Transp. threshold: 32";
+ lblTransparency.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // tbTransparency
+ //
+ tbTransparency.AutoSize = false;
+ tbTransparency.Cursor = System.Windows.Forms.Cursors.SizeWE;
+ tbTransparency.LargeChange = 16;
+ tbTransparency.Location = new System.Drawing.Point(464, 296);
+ tbTransparency.Maximum = 255;
+ tbTransparency.Name = "tbTransparency";
+ tbTransparency.Size = new System.Drawing.Size(128, 32);
+ tbTransparency.SmallChange = 4;
+ tbTransparency.TabIndex = 21;
+ tbTransparency.TickFrequency = 8;
+ toolTip1.SetToolTip(tbTransparency, "Transparency threshold. Higher value makes more white");
+ tbTransparency.Value = 4;
+ tbTransparency.ValueChanged += tbTransparency_ValueChanged;
+ tbTransparency.KeyDown += tbTransparency_KeyDown;
+ //
+ // toolTip1
+ //
+ toolTip1.AutoPopDelay = 10000;
+ toolTip1.InitialDelay = 500;
+ toolTip1.ReshowDelay = 100;
+ //
+ // label5
+ //
+ label5.AutoSize = true;
+ label5.Location = new System.Drawing.Point(438, 282);
+ label5.Name = "label5";
+ label5.Size = new System.Drawing.Size(66, 15);
+ label5.TabIndex = 24;
+ label5.Text = "More black";
+ //
+ // label6
+ //
+ label6.AutoSize = true;
+ label6.Location = new System.Drawing.Point(555, 282);
+ label6.Name = "label6";
+ label6.Size = new System.Drawing.Size(67, 15);
+ label6.TabIndex = 23;
+ label6.Text = "More white";
+ label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // ImageImporter
+ //
+ AcceptButton = btnOK;
+ AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ CancelButton = btnCancel;
+ ClientSize = new System.Drawing.Size(634, 381);
+ Controls.Add(label5);
+ Controls.Add(label6);
+ Controls.Add(lblTransparency);
+ Controls.Add(tbTransparency);
+ Controls.Add(label4);
+ Controls.Add(label3);
+ Controls.Add(label2);
+ Controls.Add(label1);
+ Controls.Add(lblScaledSize);
+ Controls.Add(lblProcessedSize);
+ Controls.Add(lblOrigSize);
+ Controls.Add(btnResize);
+ Controls.Add(lblBlack);
+ Controls.Add(lblWhite);
+ Controls.Add(lblThreshold);
+ Controls.Add(tbThreshold);
+ Controls.Add(lblPixelization);
+ Controls.Add(tbPixelization);
+ Controls.Add(btnConvert);
+ Controls.Add(pbScaled);
+ Controls.Add(btnLoadImage);
+ Controls.Add(pbProcessed);
+ Controls.Add(pbOriginal);
+ Controls.Add(btnCancel);
+ Controls.Add(btnOK);
+ FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ MaximizeBox = false;
+ MinimizeBox = false;
+ Name = "ImageImporter";
+ ShowIcon = false;
+ ShowInTaskbar = false;
+ StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ Text = "Import Image";
+ Paint += ImageImporter_Paint;
+ ((System.ComponentModel.ISupportInitialize)pbOriginal).EndInit();
+ ((System.ComponentModel.ISupportInitialize)pbProcessed).EndInit();
+ ((System.ComponentModel.ISupportInitialize)pbScaled).EndInit();
+ ((System.ComponentModel.ISupportInitialize)tbPixelization).EndInit();
+ ((System.ComponentModel.ISupportInitialize)tbThreshold).EndInit();
+ ((System.ComponentModel.ISupportInitialize)tbTransparency).EndInit();
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button btnOK;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.PictureBox pbOriginal;
+ private System.Windows.Forms.PictureBox pbProcessed;
+ private System.Windows.Forms.Button btnLoadImage;
+ private System.Windows.Forms.OpenFileDialog dlgLoadImage;
+ private System.Windows.Forms.PictureBox pbScaled;
+ private System.Windows.Forms.Button btnConvert;
+ private System.Windows.Forms.TrackBar tbPixelization;
+ private System.Windows.Forms.Label lblPixelization;
+ private System.Windows.Forms.Label lblThreshold;
+ private System.Windows.Forms.TrackBar tbThreshold;
+ private System.Windows.Forms.Label lblWhite;
+ private System.Windows.Forms.Label lblBlack;
+ private System.Windows.Forms.Button btnResize;
+ private System.Windows.Forms.Label lblOrigSize;
+ private System.Windows.Forms.Label lblProcessedSize;
+ private System.Windows.Forms.Label lblScaledSize;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label lblTransparency;
+ private System.Windows.Forms.TrackBar tbTransparency;
+ private System.Windows.Forms.ToolTip toolTip1;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Label label6;
+ }
+}
\ No newline at end of file
diff --git a/McBitFont/ImageImporter.cs b/McBitFont/ImageImporter.cs
new file mode 100644
index 0000000..3e0adfc
--- /dev/null
+++ b/McBitFont/ImageImporter.cs
@@ -0,0 +1,235 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace McBitFont {
+ public partial class ImageImporter : Form {
+
+ private int fw, fh, pixelization, threshold;
+ private Color[] colorPool = [Color.Black, Color.White];
+ private Bitmap bmpOriginal, bmpProcessed;
+ public Bitmap bmpScaled;
+
+ public ImageImporter(int width, int height) {
+ InitializeComponent();
+ fw = width;
+ fh = height;
+ }
+
+ private void UpdateControls(byte level) {
+ switch (level) {
+ case 1:
+ bmpProcessed = null;
+ bmpScaled = null;
+ pbProcessed.Image = null;
+ pbScaled.Image = null;
+ lblProcessedSize.Text = "0 x 0";
+ lblScaledSize.Text = "0 x 0";
+ btnResize.Enabled = false;
+ btnOK.Enabled = false;
+ btnConvert.Enabled = true;
+ break;
+ case 2:
+ bmpScaled = null;
+ pbScaled.Image = null;
+ lblScaledSize.Text = "0 x 0";
+ btnOK.Enabled = false;
+ btnResize.Enabled = true;
+ break;
+ case 3:
+ btnOK.Enabled = true;
+ break;
+ }
+ }
+
+ private void btnOK_Click(object sender, EventArgs e) {
+ DialogResult = DialogResult.OK;
+ }
+
+ private void btnCancel_Click(object sender, EventArgs e) {
+ DialogResult = DialogResult.Cancel;
+ }
+
+ // Pick a color from color pool that is closest to an average of given colors
+ private Color PickColor(Color[] colors) {
+ int i;
+ int r = 0; int g = 0; int b = 0;
+
+ // Calculating average color amongst givet color set
+ for (i = 0; i < colors.Length; i++) {
+ r += colors[i].R;
+ g += colors[i].G;
+ b += colors[i].B;
+ }
+ r /= colors.Length;
+ g /= colors.Length;
+ b /= colors.Length;
+
+ int near = 1000;
+ int ind = 0;
+
+ // Picking a closts color from color pool
+ for (i = 0; i < colorPool.Length; i++) {
+ int valR = colorPool[i].R - r + threshold;
+ int valG = colorPool[i].R - g + threshold;
+ int valB = colorPool[i].R - b + threshold;
+ if (valR < 0) valR = -valR;
+ if (valG < 0) valG = -valG;
+ if (valB < 0) valB = -valB;
+
+ threshold = tbThreshold.Value;
+ int total = valR + valG + valB;
+
+ if (total < near) {
+ ind = i;
+ near = total;
+ }
+ }
+ return colorPool[ind];
+ }
+
+ private static void DrawArrow(Graphics g, Point from, Point to, float thickness = 1, Color? color = null) {
+ if (color == null) color = Color.Black;
+ var pen = new Pen((Color)color, thickness) {
+ CustomEndCap = new AdjustableArrowCap(4, 5)
+ };
+ g.DrawLine(pen, from, to);
+ }
+
+ private void tbPixelization_ValueChanged(object sender, EventArgs e) {
+ lblPixelization.Text = "Pixelization: " + tbPixelization.Value.ToString();
+ }
+
+ private void tbThreshold_ValueChanged(object sender, EventArgs e) {
+ lblThreshold.Text = "Threshold: " + tbThreshold.Value.ToString();
+ }
+
+ private void btnLoadImage_Click(object sender, EventArgs e) {
+ if (dlgLoadImage.ShowDialog() == DialogResult.OK) {
+ bmpOriginal = new Bitmap(dlgLoadImage.FileName);
+
+ pbOriginal.Image = Draw200x200(bmpOriginal);
+ lblOrigSize.Text = bmpOriginal.Width.ToString() + " x " + bmpOriginal.Height.ToString()
+ + " (" + pbOriginal.Image.Width.ToString() + " x " + pbOriginal.Image.Height.ToString() + ")";
+
+ // Clear other images
+ UpdateControls(1);
+ }
+ }
+
+ private void btnConvert_Click(object sender, EventArgs e) {
+ pixelization = tbPixelization.Value;
+ //Bitmap bmOrig = (Bitmap)pbOriginal.Image;
+ bmpProcessed = new Bitmap(bmpOriginal.Width, bmpOriginal.Height);
+
+ // Processing image
+ using (Graphics g = Graphics.FromImage(bmpProcessed)) {
+ List block;
+ Rectangle rect = new Rectangle();
+ SolidBrush sb = new SolidBrush(Color.Black);
+ Color final = Color.Black;
+ Color pixel;
+
+ // Going through original image with steps = pixelization
+ for (int x = 0; x < bmpOriginal.Width; x += pixelization) {
+ for (int y = 0; y < bmpOriginal.Height; y += pixelization) {
+ block = [];
+
+ // Going throug a block pixel by pixel to calculate its average color later
+ for (int v = 0; v < pixelization; v++) {
+ for (int c = 0; c < pixelization; c++) {
+ if (x + v < bmpOriginal.Width && y + c < bmpOriginal.Height) {
+ pixel = bmpOriginal.GetPixel(x + v, y + c);
+ if (pixel.A <= tbTransparency.Value) pixel = Color.White;
+ block.Add(pixel);
+ }
+ }
+ }
+
+ // Getting a color from the color pool and painting the block
+ if (block.Count > 0) {
+ final = PickColor(block.ToArray());
+ sb.Color = final;
+
+ rect.X = x;
+ rect.Y = y;
+ rect.Width = pixelization;
+ rect.Height = pixelization;
+
+ g.FillRectangle(sb, rect);
+ }
+ }
+ }
+ }
+
+ pbProcessed.Image = Draw200x200(bmpProcessed);
+ lblProcessedSize.Text = bmpProcessed.Width.ToString() + " x " + bmpProcessed.Height.ToString()
+ + " (" + pbProcessed.Image.Width.ToString() + " x " + pbProcessed.Image.Height.ToString() + ")";
+
+ UpdateControls(2);
+ }
+
+ private void btnResize_Click(object sender, EventArgs e) {
+ bmpScaled = DrawScaled(bmpProcessed, fw, fh);
+
+ pbScaled.Image = Draw200x200(bmpScaled);
+ lblScaledSize.Text = bmpScaled.Width.ToString() + " x " + bmpScaled.Height.ToString()
+ + " (" + pbScaled.Image.Width.ToString() + " x " + pbScaled.Image.Height.ToString() + ")";
+ UpdateControls(3);
+ }
+
+ // Draw 200x200 bitmap for picturebox
+ private static Bitmap Draw200x200(Bitmap bmpRef) {
+ return DrawScaled(bmpRef, 200, 200);
+ }
+
+ // Draw scaled bitmap keeping aspect ratio
+ private static Bitmap DrawScaled(Bitmap bmpRef, int w, int h) {
+ var scale = Math.Min(w / (double)bmpRef.Width, h / (double)bmpRef.Height);
+ var bmpNew = new Bitmap((int)(bmpRef.Width * scale), (int)(bmpRef.Height * scale));
+
+ using (Graphics g = Graphics.FromImage(bmpNew)) {
+ g.InterpolationMode = InterpolationMode.NearestNeighbor;
+ g.PixelOffsetMode = PixelOffsetMode.Half;
+ g.DrawImage(bmpRef, 0, 0, bmpNew.Width, bmpNew.Height);
+ }
+
+ return bmpNew;
+ }
+
+ private void tbThreshold_KeyDown(object sender, KeyEventArgs e) {
+ if (e.KeyCode == Keys.C) {
+ tbThreshold.Value = 0;
+ }
+ }
+
+ private void tbPixelization_KeyDown(object sender, KeyEventArgs e) {
+ if (e.KeyCode == Keys.C) {
+ tbPixelization.Value = 1;
+ }
+ }
+
+ private void tbTransparency_ValueChanged(object sender, EventArgs e) {
+ lblTransparency.Text = "Transp. threshold: " + tbTransparency.Value.ToString();
+ }
+
+ private void tbTransparency_KeyDown(object sender, KeyEventArgs e) {
+ if (e.KeyCode == Keys.C) {
+ tbTransparency.Value = 32;
+ }
+ }
+
+ private void ImageImporter_Paint(object sender, PaintEventArgs e) {
+ DrawArrow(e.Graphics, new Point(175, 246), new Point(255, 246), 2, Color.SlateGray);
+ DrawArrow(e.Graphics, new Point(380, 246), new Point(455, 246), 2, Color.SlateGray);
+ }
+ }
+}
diff --git a/McBitFont/ImageImporter.resx b/McBitFont/ImageImporter.resx
new file mode 100644
index 0000000..9a6538c
--- /dev/null
+++ b/McBitFont/ImageImporter.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 147, 17
+
+
\ No newline at end of file
diff --git a/McBitFont/Properties/Resources.Designer.cs b/McBitFont/Properties/Resources.Designer.cs
index 844f1e4..2d26efd 100644
--- a/McBitFont/Properties/Resources.Designer.cs
+++ b/McBitFont/Properties/Resources.Designer.cs
@@ -60,36 +60,6 @@ namespace McBitFont.Properties {
}
}
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap action_add {
- get {
- object obj = ResourceManager.GetObject("action_add", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap action_check {
- get {
- object obj = ResourceManager.GetObject("action_check", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap action_remove {
- get {
- object obj = ResourceManager.GetObject("action_remove", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -103,29 +73,9 @@ namespace McBitFont.Properties {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap arrow_back {
+ internal static System.Drawing.Bitmap arrow_inout {
get {
- object obj = ResourceManager.GetObject("arrow_back", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap arrow_down {
- get {
- object obj = ResourceManager.GetObject("arrow_down", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap arrow_next {
- get {
- object obj = ResourceManager.GetObject("arrow_next", resourceCulture);
+ object obj = ResourceManager.GetObject("arrow_inout", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -143,9 +93,9 @@ namespace McBitFont.Properties {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap arrow_top {
+ internal static System.Drawing.Bitmap arrow_undo {
get {
- object obj = ResourceManager.GetObject("arrow_top", resourceCulture);
+ object obj = ResourceManager.GetObject("arrow_undo", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -153,9 +103,9 @@ namespace McBitFont.Properties {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap arrow_undo {
+ internal static System.Drawing.Bitmap calculator {
get {
- object obj = ResourceManager.GetObject("arrow_undo", resourceCulture);
+ object obj = ResourceManager.GetObject("calculator", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -190,26 +140,6 @@ namespace McBitFont.Properties {
}
}
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap Famfamfam_Silk_Folder_16 {
- get {
- object obj = ResourceManager.GetObject("Famfamfam-Silk-Folder.16", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap Famfamfam_Silk_Folder_page_16 {
- get {
- object obj = ResourceManager.GetObject("Famfamfam-Silk-Folder-page.16", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -310,26 +240,6 @@ namespace McBitFont.Properties {
}
}
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap Ionic_Ionicons_Invert_mode_outline_16 {
- get {
- object obj = ResourceManager.GetObject("Ionic-Ionicons-Invert-mode-outline.16", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap save {
- get {
- object obj = ResourceManager.GetObject("save", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -380,6 +290,16 @@ namespace McBitFont.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap z_folder_image {
+ get {
+ object obj = ResourceManager.GetObject("z_folder_image", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/McBitFont/Properties/Resources.resx b/McBitFont/Properties/Resources.resx
index 085f933..e7614bc 100644
--- a/McBitFont/Properties/Resources.resx
+++ b/McBitFont/Properties/Resources.resx
@@ -118,121 +118,97 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- ..\Resources\icon_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Ionic-Ionicons-Invert-mode-outline.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_next.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Page-copy.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_back.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Page-white.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Shape-flip-horizontal.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Door-out.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Folder-page.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\action_remove.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\action_add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\folder_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Disk.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Page-paste.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\file.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\icon_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Shape-flip-vertical.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\Famfamfam-Silk-Folder.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_top.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\action_check.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\tick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_redo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_undo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
..\Resources\arrow_left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\..\icons\famfamfam\arrow_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\arrow_up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\shape_align_center.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\asterisk_orange.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\shading.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
..\Resources\package_go.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\contrast.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Famfamfam-Silk-Page-paste.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\folder_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Famfamfam-Silk-Page-copy.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrow_inout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\redo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Famfamfam-Silk-Disk.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrow_right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Famfamfam-Silk-Door-out.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\asterisk_orange.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\..\icons\famfamfam\arrow_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrow_up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\file.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\shape_align_center.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\shading.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\icon_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrow_undo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\tick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\arrow_redo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Famfamfam-Silk-Page-white.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Famfamfam-Silk-Shape-flip-horizontal.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Famfamfam-Silk-Shape-flip-vertical.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\folder_image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\undo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icon_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\calculator.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/McBitFont/Resources/arrow_inout.png b/McBitFont/Resources/arrow_inout.png
new file mode 100644
index 0000000..1b76367
Binary files /dev/null and b/McBitFont/Resources/arrow_inout.png differ
diff --git a/McBitFont/Resources/calculator.png b/McBitFont/Resources/calculator.png
new file mode 100644
index 0000000..701a60a
Binary files /dev/null and b/McBitFont/Resources/calculator.png differ
diff --git a/McBitFont/Resources/folder_image.png b/McBitFont/Resources/folder_image.png
new file mode 100644
index 0000000..d5df75b
Binary files /dev/null and b/McBitFont/Resources/folder_image.png differ
diff --git a/TODO.txt b/TODO.txt
index 69c4ca2..7596bc0 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -13,7 +13,7 @@ V Shift all symbols on code line (change symbol codes)
V Specify starting code (extends the shift)
V Ability to make monospaced font a variable width one
V Undo/Redo for canvas changes
-- Image import from a file
+V Image import from a file
- Import from a text array
- Rectangle selection to mass-paint, shift and mirror pixels
V "Packed" fonts export
diff --git a/examples/tests/1310396764_rss.png b/examples/tests/1310396764_rss.png
new file mode 100644
index 0000000..b44b1a0
Binary files /dev/null and b/examples/tests/1310396764_rss.png differ
diff --git a/examples/tests/1310396765_msn.png b/examples/tests/1310396765_msn.png
new file mode 100644
index 0000000..f069da5
Binary files /dev/null and b/examples/tests/1310396765_msn.png differ
diff --git a/examples/tests/1310396769_gmail.png b/examples/tests/1310396769_gmail.png
new file mode 100644
index 0000000..87af9a7
Binary files /dev/null and b/examples/tests/1310396769_gmail.png differ
diff --git a/examples/tests/1310396774_facebook.png b/examples/tests/1310396774_facebook.png
new file mode 100644
index 0000000..e718c15
Binary files /dev/null and b/examples/tests/1310396774_facebook.png differ
diff --git a/examples/tests/1310396812_apple.png b/examples/tests/1310396812_apple.png
new file mode 100644
index 0000000..ab2fd44
Binary files /dev/null and b/examples/tests/1310396812_apple.png differ
diff --git a/examples/tests/1310396820_linux.png b/examples/tests/1310396820_linux.png
new file mode 100644
index 0000000..42cc3b3
Binary files /dev/null and b/examples/tests/1310396820_linux.png differ
diff --git a/examples/tests/1310396823_icq.png b/examples/tests/1310396823_icq.png
new file mode 100644
index 0000000..44a722f
Binary files /dev/null and b/examples/tests/1310396823_icq.png differ
diff --git a/examples/tests/1310396825_YouTube.png b/examples/tests/1310396825_YouTube.png
new file mode 100644
index 0000000..2c8eaca
Binary files /dev/null and b/examples/tests/1310396825_YouTube.png differ
diff --git a/examples/tests/derevya.jpg b/examples/tests/derevya.jpg
new file mode 100644
index 0000000..e6fe82c
Binary files /dev/null and b/examples/tests/derevya.jpg differ
diff --git a/examples/tests/flipper.png b/examples/tests/flipper.png
new file mode 100644
index 0000000..73ad23f
Binary files /dev/null and b/examples/tests/flipper.png differ
diff --git a/examples/tests/flipper_1.png b/examples/tests/flipper_1.png
new file mode 100644
index 0000000..85cf0ed
Binary files /dev/null and b/examples/tests/flipper_1.png differ
diff --git a/examples/tests/flipper_2.png b/examples/tests/flipper_2.png
new file mode 100644
index 0000000..e5e8678
Binary files /dev/null and b/examples/tests/flipper_2.png differ
diff --git a/examples/tests/flipper_3.png b/examples/tests/flipper_3.png
new file mode 100644
index 0000000..b491d33
Binary files /dev/null and b/examples/tests/flipper_3.png differ
diff --git a/examples/tests/flipper_6.png b/examples/tests/flipper_6.png
new file mode 100644
index 0000000..cbf46d3
Binary files /dev/null and b/examples/tests/flipper_6.png differ
diff --git a/examples/tests/flipper_multiple.png b/examples/tests/flipper_multiple.png
new file mode 100644
index 0000000..dfdaa95
Binary files /dev/null and b/examples/tests/flipper_multiple.png differ
diff --git a/examples/tests/flipper_round.png b/examples/tests/flipper_round.png
new file mode 100644
index 0000000..9ef9fb5
Binary files /dev/null and b/examples/tests/flipper_round.png differ
diff --git a/examples/tests/panda.png b/examples/tests/panda.png
new file mode 100644
index 0000000..50d9d12
Binary files /dev/null and b/examples/tests/panda.png differ
diff --git a/icons/famfamfam/arrow_inout.png b/icons/famfamfam/arrow_inout.png
new file mode 100644
index 0000000..1b76367
Binary files /dev/null and b/icons/famfamfam/arrow_inout.png differ
diff --git a/icons/famfamfam/calculator.png b/icons/famfamfam/calculator.png
new file mode 100644
index 0000000..701a60a
Binary files /dev/null and b/icons/famfamfam/calculator.png differ
diff --git a/icons/famfamfam/folder_image.png b/icons/famfamfam/folder_image.png
new file mode 100644
index 0000000..d5df75b
Binary files /dev/null and b/icons/famfamfam/folder_image.png differ