예제 #1
0
        public Bitmap getMapImage(bool crop = false, bool entity = true, bool sliceArea = false)
        {
            // Load MM
            byte[][] MM = mini.unpackMini(File.ReadAllBytes(MapMatrixes[DrawMap]), "MM");
            var      mm = OWSE.mm = new MapMatrix(MM);

            // Unknown
            if (ModifierKeys == Keys.Control)
            {
                Clipboard.SetText(mm.Unk2String());
            }

            // Load GR TileMaps
            for (int i = 0; i < mm.EntryList.Length; i++)
            {
                if (mm.EntryList[i] == 0xFFFF) // Mystery Zone
                {
                    continue;
                }
                byte[][] GR = mini.unpackMini(File.ReadAllBytes(MapGRs[mm.EntryList[i]]), "GR");
                mm.Entries[i] = new MapMatrix.Entry(GR[0])
                {
                    coll = new MapMatrix.Collision(GR[2])
                };
            }
            mapScale = Math.Max(1, (int)NUD_Scale.Value);
            Bitmap img = mm.Preview(mapScale, (int)NUD_Flavor.Value);

            baseImage = (Bitmap)img.Clone();

            if (sliceArea && mapScale > 3)
            {
                int area = 40 * mapScale;
                for (int x = 0; x < img.Width; x++)
                {
                    for (int y = 0; y < img.Height; y++)
                    {
                        if (x % area == 0 || y % area == 0)
                        {
                            img.SetPixel(x, y, Color.FromArgb(0x10, 0xFF, 0, 0));
                        }
                    }
                }
            }

            if (entity && mapScale == 8)
            {
                img = overlayEntities(img);
            }

            if (crop)
            {
                img = WinFormsUtil.TrimBitmap(img);
            }

            return(img);
        }
예제 #2
0
        private void dclickMap(object sender, EventArgs e)
        {
            DialogResult dr = WinFormsUtil.Prompt(MessageBoxButtons.YesNoCancel, "Copy image to Clipboard?",
                                                  "Yes: Map & Overworlds" + Environment.NewLine + "No: Map Only");

            if (dr == DialogResult.No) // Map Only
            {
                Clipboard.SetImage(WinFormsUtil.TrimBitmap(baseImage));
            }
            if (dr == DialogResult.Yes)
            {
                Clipboard.SetImage(PB_Map.Image);
            }
        }