Example #1
0
        private void ExtractFacetAs(ImageFormat format, string extention)
        {
            Cursor.Current = Cursors.WaitCursor;
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            string name = String.Format("facet0{0}-{1}.{2}", currmapint, Options.MapNames[currmapint], extention);
            string FileName = Path.Combine(path, name);
            if (Facet == null || Facet.FileIndex != currmapint)
            {
                Facet = new Ultima.Facet(currmap.FileIndex);
                Facet.Preload();
            }

            if (showMarkersToolStripMenuItem.Checked)
            {
                Graphics g = Graphics.FromImage(Facet.Bitmap);
                foreach (TreeNode obj in OverlayObjectTree.Nodes[currmapint].Nodes)
                {
                    OverlayObject o = (OverlayObject)obj.Tag;
                    if (o.Visible)
                        o.DrawOnFacet(g);
                }
                g.Save();

                Facet.Bitmap.Save(FileName, format);
                Facet.Preload();
            }
            else
                Facet.Bitmap.Save(FileName, format);
            Cursor.Current = Cursors.Default;
            MessageBox.Show(String.Format("Карта была успешно сохранена: {0}", FileName), "Сохраненно",
                MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
        }
Example #2
0
 private void GenerateFacet(Ultima.Map map, Bitmap bitmap)
 {
     Cursor.Current = Cursors.WaitCursor;
     Ultima.Facet facet = new Ultima.Facet(map.FileIndex, bitmap);
     string FileName = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, String.Format("facet0{0}.mul", map.FileIndex));
     facet.Save(FileName);
     Cursor.Current = Cursors.Default;
     MessageBox.Show(String.Format("Facet0{0} был создан и сохранен: {1}", map.FileIndex, FileName), "Сохраненно",
                     MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
 }
Example #3
0
        private void ChangeFacet()
        {
            if (ViewMod != ViewModType.Facet)
                return;

            Cursor.Current = Cursors.WaitCursor;
            Facet = new Ultima.Facet(currmap.FileIndex);
            Facet.Preload();
            pictureBox.Invalidate();
            Cursor.Current = Cursors.Default;
        }