public static BitmapChangeColorPopUp Open(Bitmap bitmap, bool createMask) { if (_singleton == null) { _singleton = new BitmapChangeColorPopUp(); } _singleton._bmp = bitmap; _singleton._backColor = Tilesheet.InferBackgroundColor(bitmap); _singleton.picBox.BackColor = _singleton._backColor; _singleton._isMask = createMask; if (!createMask) { _singleton.lblMessage.Text = "Select color to change"; _singleton.Text = "Change Background"; } else { _singleton.lblMessage.Text = "Select transparency key"; _singleton.Text = "Create Mask"; } _singleton.Show(); return(_singleton); }
public static BitmapChangeColorPopUp Open(Bitmap bitmap, bool createMask) { if (_singleton == null) _singleton = new BitmapChangeColorPopUp(); _singleton._bmp = bitmap; _singleton._backColor = Tilesheet.InferBackgroundColor(bitmap); _singleton.picBox.BackColor = _singleton._backColor; _singleton._isMask = createMask; if (!createMask) { _singleton.lblMessage.Text = "Select color to change"; _singleton.Text = "Change Background"; } else { _singleton.lblMessage.Text = "Select transparency key"; _singleton.Text = "Create Mask"; } _singleton.Show(); return _singleton; }
private void BitmapChangeColorPopUp_FormClosed(object sender, FormClosedEventArgs e) { _singleton = null; }