コード例 #1
0
ファイル: LMain.cs プロジェクト: shellohunter/mir2
        private void copyToToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (PreviewListView.SelectedIndices.Count == 0)
            {
                return;
            }
            if (SaveLibraryDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            MLibrary tempLibrary = new MLibrary(SaveLibraryDialog.FileName);

            List <int> copyList = new List <int>();


            for (int i = 0; i < PreviewListView.SelectedIndices.Count; i++)
            {
                copyList.Add(PreviewListView.SelectedIndices[i]);
            }

            copyList.Sort();
            for (int i = 0; i < copyList.Count; i++)
            {
                MLibrary.MImage image = _library.GetMImage(copyList[i]);
                tempLibrary.AddImage(image.Image, image.X, image.Y);
            }

            tempLibrary.Save();
        }
コード例 #2
0
ファイル: LMain.cs プロジェクト: zixinren/wzl
        private void OffSetYTextBox_TextChanged(object sender, EventArgs e)
        {
            TextBox control = sender as TextBox;

            if (control == null || !control.Focused)
            {
                return;
            }

            short temp;

            if (!short.TryParse(control.Text, out temp))
            {
                control.BackColor = Color.Red;
                return;
            }

            control.BackColor = SystemColors.Window;

            for (int i = 0; i < PreviewListView.SelectedIndices.Count; i++)
            {
                MLibrary.MImage image = _library.GetMImage(PreviewListView.SelectedIndices[i]);
                image.Y = temp;
            }
        }
コード例 #3
0
ファイル: LMain.cs プロジェクト: shellohunter/mir2
        private void ClearInterface()
        {
            _selectedImage = null;
            ImageBox.Image = null;

            WidthLabel.Text          = "<No Image>";
            HeightLabel.Text         = "<No Image>";
            OffSetXTextBox.Text      = string.Empty;
            OffSetYTextBox.Text      = string.Empty;
            OffSetXTextBox.BackColor = SystemColors.Window;
            OffSetYTextBox.BackColor = SystemColors.Window;
        }
コード例 #4
0
ファイル: LMain.cs プロジェクト: zixinren/wzl
        private void PreviewListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PreviewListView.SelectedIndices.Count == 0)
            {
                ClearInterface();
                return;
            }

            _selectedImage = _library.GetMImage(PreviewListView.SelectedIndices[0]);

            if (_selectedImage == null)
            {
                ClearInterface();
                return;
            }



            OffSetXTextBox.Text = _selectedImage.X.ToString();
            OffSetYTextBox.Text = _selectedImage.Y.ToString();

            ImageBox.Image = _selectedImage.Image;

            ////---------------------这里写黑边代码-------------------


            //Texture ImageFuZhi = new Texture(DXManager.Device, _selectedImage._Image.Width, _selectedImage._Image.Height, 1, Usage.None, Format.A8R8G8B8, Pool.Managed);
            //GraphicsStream stream = ImageFuZhi.LockRectangle(0, LockFlags.Discard);
            //byte[] decomp = BitmapToBytes(_selectedImage._Image);
            //stream.Write(decomp, 0, decomp.Length);
            //stream.Dispose();
            //ImageFuZhi.UnlockRectangle(0);


            ////-------------------------------------
            // Keep track of what image/s are selected.
            if (PreviewListView.SelectedIndices.Count > 1)
            {
                toolStripStatusLabel.ForeColor = Color.Red;
                toolStripStatusLabel.Text      = "Multiple images selected.";
            }
            else
            {
                toolStripStatusLabel.ForeColor = SystemColors.ControlText;
                toolStripStatusLabel.Text      = "Selected Image: " + string.Format("{0} / {1}",
                                                                                    PreviewListView.SelectedIndices[0].ToString(),
                                                                                    (PreviewListView.Items.Count - 1).ToString());
            }

            nudJump.Value = PreviewListView.SelectedIndices[0];
        }
コード例 #5
0
ファイル: LMain.cs プロジェクト: shellohunter/mir2
        private void PreviewListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PreviewListView.SelectedIndices.Count == 0)
            {
                ClearInterface();
                return;
            }

            _selectedImage = _library.GetMImage(PreviewListView.SelectedIndices[0]);

            if (_selectedImage == null)
            {
                ClearInterface();
                return;
            }
            WidthLabel.Text     = _selectedImage.Width.ToString();
            HeightLabel.Text    = _selectedImage.Height.ToString();
            OffSetXTextBox.Text = _selectedImage.X.ToString();
            OffSetYTextBox.Text = _selectedImage.Y.ToString();
            ImageBox.Image      = _selectedImage.Image;
        }
コード例 #6
0
ファイル: LMain.cs プロジェクト: zhaooptimus/mir2
        private void PreviewListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PreviewListView.SelectedIndices.Count == 0)
            {
                ClearInterface();
                return;
            }

            _selectedImage = _library.GetMImage(PreviewListView.SelectedIndices[0]);

            if (_selectedImage == null)
            {
                ClearInterface();
                return;
            }

            WidthLabel.Text  = _selectedImage.Width.ToString();
            HeightLabel.Text = _selectedImage.Height.ToString();

            OffSetXTextBox.Text = _selectedImage.X.ToString();
            OffSetYTextBox.Text = _selectedImage.Y.ToString();

            ImageBox.Image = _selectedImage.Image;

            // Keep track of what image/s are selected.
            if (PreviewListView.SelectedIndices.Count > 1)
            {
                toolStripStatusLabel.ForeColor = Color.Red;
                toolStripStatusLabel.Text      = "Multiple images selected.";
            }
            else
            {
                toolStripStatusLabel.ForeColor = SystemColors.ControlText;
                toolStripStatusLabel.Text      = "Selected Image: " + string.Format("{0} / {1}",
                                                                                    PreviewListView.SelectedIndices[0].ToString(),
                                                                                    (PreviewListView.Items.Count - 1).ToString());
            }

            nudJump.Value = PreviewListView.SelectedIndices[0];
        }
コード例 #7
0
ファイル: LMain.cs プロジェクト: xiaofengzhiyu/CSharpMir
        private void ClearInterface()
        {
            _selectedImage = null;
            ImageBox.Image = null;

            WidthLabel.Text = "<No Image>";
            HeightLabel.Text = "<No Image>";
            OffSetXTextBox.Text = string.Empty;
            OffSetYTextBox.Text = string.Empty;
            OffSetXTextBox.BackColor = SystemColors.Window;
            OffSetYTextBox.BackColor = SystemColors.Window;
        }
コード例 #8
0
ファイル: LMain.cs プロジェクト: xiaofengzhiyu/CSharpMir
        private void PreviewListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PreviewListView.SelectedIndices.Count == 0)
            {
                ClearInterface();
                return;
            }

            _selectedImage = _library.GetMImage(PreviewListView.SelectedIndices[0]);

            if (_selectedImage == null)
            {
                ClearInterface();
                return;
            }
            WidthLabel.Text = _selectedImage.Width.ToString();
            HeightLabel.Text = _selectedImage.Height.ToString();
            OffSetXTextBox.Text = _selectedImage.X.ToString();
            OffSetYTextBox.Text = _selectedImage.Y.ToString();

            ImageBox.Image = _selectedImage.Image;
        }
コード例 #9
0
ファイル: LMain.cs プロジェクト: quttap/mir2
        private void PreviewListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PreviewListView.SelectedIndices.Count == 0)
            {
                ClearInterface();
                return;
            }

            _selectedImage = _library.GetMImage(PreviewListView.SelectedIndices[0]);

            if (_selectedImage == null)
            {
                ClearInterface();
                return;
            }

            WidthLabel.Text = _selectedImage.Width.ToString();
            HeightLabel.Text = _selectedImage.Height.ToString();

            OffSetXTextBox.Text = _selectedImage.X.ToString();
            OffSetYTextBox.Text = _selectedImage.Y.ToString();

            ImageBox.Image = _selectedImage.Image;

            // Keep track of what image/s are selected.
            if (PreviewListView.SelectedIndices.Count > 1)
            {
                toolStripStatusLabel.ForeColor = Color.Red;
                toolStripStatusLabel.Text = "Multiple images selected.";
            }
            else
            {
                toolStripStatusLabel.ForeColor = SystemColors.ControlText;
                toolStripStatusLabel.Text = "Selected Image: " + string.Format("{0} / {1}",
                PreviewListView.SelectedIndices[0].ToString(),
                (PreviewListView.Items.Count - 1).ToString());
            }

            nudJump.Value = PreviewListView.SelectedIndices[0];
        }