Пример #1
0
        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];
        }
Пример #2
0
        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;
        }
Пример #3
0
        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];
        }