Beispiel #1
0
        private void SelectColor(ref int intR, ref int intG, ref int intB)
        {
            TextBox tbR = new TextBox();
            TextBox tbG = new TextBox();
            TextBox tbB = new TextBox();

            tbR.Text = "" + intR;
            tbG.Text = "" + intG;
            tbB.Text = "" + intB;

            // sync > @ _WindRect_SelectColorDlg

            try
            {
                int[] defColors = new int[16];

                for (int index = 0; index < 16; index++)
                {
                    defColors[index] = index * 0x081008 + 0x800000;
                }

                Color color;

                {
                    int r = int.Parse(tbR.Text) & 0xff;
                    int g = int.Parse(tbG.Text) & 0xff;
                    int b = int.Parse(tbB.Text) & 0xff;

                    color = Color.FromArgb(r, g, b);
                }

                if (SaveLoadDialogs.SelectColor(ref color, defColors))
                {
                    int r = color.R;
                    int g = color.G;
                    int b = color.B;

                    tbR.Text = "" + r;
                    tbG.Text = "" + g;
                    tbB.Text = "" + b;
                }
            }
            catch
            { }

            // < sync

            intR = int.Parse(tbR.Text);
            intG = int.Parse(tbG.Text);
            intB = int.Parse(tbB.Text);

            this.SomethingModified = true;
        }
Beispiel #2
0
        private void テキストをファイルに保存するSToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string outFile = SaveLoadDialogs.SaveFile(
                "保存先のファイルを指定して下さい",
                "テキスト:txt",
                Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                "WindRect_Text_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt"
                );

            if (outFile != null)
            {
                File.WriteAllText(outFile, Utils2.Unescape(this.RI.Text), Encoding.UTF8);
            }
        }
Beispiel #3
0
        private void 色Btn_Click(object sender, EventArgs e)
        {
            TextBox tbR = this.ColorRText;
            TextBox tbG = this.ColorGText;
            TextBox tbB = this.ColorBText;

            // sync > @ _WindRect_SelectColorDlg

            try
            {
                int[] defColors = new int[16];

                for (int index = 0; index < 16; index++)
                {
                    defColors[index] = index * 0x081008 + 0x800000;
                }

                Color color;

                {
                    int r = int.Parse(tbR.Text) & 0xff;
                    int g = int.Parse(tbG.Text) & 0xff;
                    int b = int.Parse(tbB.Text) & 0xff;

                    color = Color.FromArgb(r, g, b);
                }

                if (SaveLoadDialogs.SelectColor(ref color, defColors))
                {
                    int r = color.R;
                    int g = color.G;
                    int b = color.B;

                    tbR.Text = "" + r;
                    tbG.Text = "" + g;
                    tbB.Text = "" + b;
                }
            }
            catch
            { }

            // < sync
        }
Beispiel #4
0
        private void ImageBtn_Click(object sender, EventArgs e)
        {
            string file = SaveLoadDialogs.LoadFile(
                "画像ファイルを選択して下さい",
                "",
                this.ImageFile == "" ? "" : Path.GetDirectoryName(this.ImageFile),
                this.ImageFile == "" ? "*.bmp;*.gif;*.jpg;*.jpeg;*.png" : this.ImageFile,
                dlg =>
            {
                dlg.Filter = "画像ファイル(*.bmp;*.gif;*.jpg;*.jpeg;*.png)|*.bmp;*.gif;*.jpg;*.jpeg;*.png|すべてのファイル(*.*)|*.*";
            });

            if (file != null)
            {
                this.ImageFile = Path.GetFullPath(file);
            }
            else
            {
                this.ImageFile = "";
            }

            this.UpdateUi();
        }