Request full map screen shot as normal in game view scale

smoochy boys on tour

awesome

Microsoft
Veteran
Dec 6, 2013
816
51
90
is there an option to take a full map screenshot in the map editor, the scale of the map in game?

real scale not zoomed out

is it easy to implement? if it doesn't exist

Code:
public void createMiniMap()
        {
            Bitmap miniBitmap = new Bitmap(mapWidth * 12, mapHeight * 8, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            //backimage
            for (int y = 0; y <= mapHeight - 1; y++)
            {
                for (int x = 0; x <= mapWidth - 1; x++)
                {
                    if ((M2CellInfo[x, y].BackImage & 0x1FFFFFFF) != 0)
                    {
                        try
                        {
                            Libraries.MapLibs[M2CellInfo[x, y].BackIndex].CheckImage((M2CellInfo[x, y].BackImage & 0x1FFFFFFF) - 1);
                            var mi = Libraries.MapLibs[M2CellInfo[x, y].BackIndex].Images[(M2CellInfo[x, y].BackImage & 0x1FFFFFFF) - 1];
                            if (mi.Image != null || mi.ImageTexture != null)
                            {
                                using (Graphics g = Graphics.FromImage(miniBitmap))
                                {
                                    Rectangle temprect = new Rectangle((x * 12), (y * 8), 24, 16);
                                    g.DrawImage(mi.Image, temprect);
                                }
                            }
                        }
                        catch
                        {

                        }

                    }
                    x++;
                }
                y++;
            }

            //MiddleImage
            for (int y = 0; y <= mapHeight - 1; y++)
            {
                for (int x = 0; x <= mapWidth - 1; x++)
                {
                    if ((M2CellInfo[x, y].MiddleImage) != 0)
                    {
                        try
                        {
                            Libraries.MapLibs[M2CellInfo[x, y].MiddleIndex].CheckImage((M2CellInfo[x, y].MiddleImage) - 1);
                            var mi = Libraries.MapLibs[M2CellInfo[x, y].MiddleIndex].Images[(M2CellInfo[x, y].MiddleImage) - 1];
                            if (mi.Image != null || mi.ImageTexture != null)
                            {
                                using (Graphics g = Graphics.FromImage(miniBitmap))
                                {
                                    Rectangle temprect = new Rectangle((x * 12), (y * 8) - (mi.Image.Height / 4) + 8, mi.Image.Width / 4, mi.Image.Height / 4);
                                    g.DrawImage(mi.Image, temprect);
                                }
                            }
                        }
                        catch
                        {

                        }
                    }

                }
            }



            //FrontImage
            for (int y = 0; y <= mapHeight - 1; y++)
            {
                for (int x = 0; x <= mapWidth - 1; x++)
                {
                    if ((M2CellInfo[x, y].FrontImage & 0x7FFF) != 0 && (M2CellInfo[x, y].FrontAnimationFrame & 0x80) < 1) //skips drawing if image is animated <<will this cause missing spots for waterfalls and such?
                    {
                        try
                        {
                            Libraries.MapLibs[M2CellInfo[x, y].FrontIndex].CheckImage((M2CellInfo[x, y].FrontImage & 0x7FFF) - 1);
                            var mi = Libraries.MapLibs[M2CellInfo[x, y].FrontIndex].Images[(M2CellInfo[x, y].FrontImage & 0x7FFF) - 1];
                            if (mi.Image != null || mi.ImageTexture != null)
                            {
                                using (Graphics g = Graphics.FromImage(miniBitmap))
                                {
                                    Rectangle temprect = new Rectangle((x * 12), (y * 8) - (mi.Image.Height / 4) + 8, mi.Image.Width / 4, mi.Image.Height / 4);
                                    g.DrawImage(mi.Image, temprect);
                                }
                            }
                        }
                        catch
                        {

                        }

                    }

                }
            }

            miniBitmap = new Bitmap(miniBitmap, (miniBitmap.Width), (miniBitmap.Height));

            string SimpleFileName = Path.GetDirectoryName(mapFileName) + @"\" + Path.GetFileNameWithoutExtension(mapFileName);
            //MessageBox.Show(SimpleFileName);
            miniBitmap.Save(SimpleFileName + "_MiniMap.png", ImageFormat.Png);
            MessageBox.Show("Saved... " + SimpleFileName + "_MiniMap.png"); //TODO: this shows even if failed to save
 
Last edited:

mir2pion

TL;DR
Veteran
Feb 21, 2013
3,113
513
175
It is not there. Would be good for house interiors (if you would want to make image catalogue), otherwise only for small maps, maybe up to 200 to 300 sq size. Editor would run out of memory for anything bigger.
 

awesome

Microsoft
Veteran
Dec 6, 2013
816
51
90
i plan to
export all .X files as PNG
import all images in photoshop
draw maps in photoshop
export the bmp
build wil files
then convert to lib and map file

or i just create wil files and use it on heroes mir 2 (delphi) version

in photoshop i need the resources to create a map image that can be Objects.wil from 1 to 30 and map file

like so i need all .X objects files as transparent images
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,178
30
2,780
540
Why not just export all the images to excel and make your map in that
 
  • Haha
Reactions: zedina

FloppyQ

LOMCN Member
May 12, 2020
107
2
49
30
Why not just export all the images to excel and make your map in that
Move to 15:15, take screenshot, paste to MS Paint.
Move to 15:30, take screenshot, paste to paint.
Repeat 300 times.
 
  • Like
Reactions: Far

awesome

Microsoft
Veteran
Dec 6, 2013
816
51
90
In the code I posted i changed the create minimap option divider

Now the map image is half the real scale
 

StormHero

Dedicated Member
Dedicated Member
Jan 19, 2015
924
2
281
105
i plan to
export all .X files as PNG
import all images in photoshop
draw maps in photoshop
export the bmp
build wil files
then convert to lib and map file

or i just create wil files and use it on heroes mir 2 (delphi) version

in photoshop i need the resources to create a map image that can be Objects.wil from 1 to 30 and map file

like so i need all .X objects files as transparent images
Alt + f4, is the start point. Good luck.