示例#1
0
        private void PreviewImageButton_Click(object sender, EventArgs e)
        {
            IMaterial material = (IMaterial)AssetListBox.SelectedItem;

            if (material == null)
            {
                return;
            }

            byte[] bytes = material.DumpImage();

            try {
                PreviewForm pForm = new PreviewForm(material.Name, bytes, material.Width, material.Height);
                pForm.Show();
            }
            catch {
                MessageBox.Show("There was an error processing the picture", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void DumpImageButton_Click(object sender, EventArgs e)
        {
            IMaterial material = (IMaterial)AssetListBox.SelectedItem;

            if (material == null)
            {
                return;
            }

            byte[] bytes = material.DumpImage();
            if (!Directory.Exists(@"images"))
            {
                Directory.CreateDirectory(@"images");
            }

            string fileName = @"images/" + material.Name + ".dds";

            File.WriteAllBytes(fileName, bytes);

            MessageBox.Show("Image saved to:\n\n" + fileName, "Image Dump Complete");
        }