예제 #1
0
        public int GetTileHeight()
        {
            int width, height;

            TMDLLWrapper.GetTileSize(out width, out height);
            return(height);
        }
        //gets the height
        public int GetTileHeight()
        {
            int h, w;

            TMDLLWrapper.GetTileSize(out w, out h);
            return(h);
        }
        //Gets the width
        public int GetTileWidth()
        {
            int h, w;

            TMDLLWrapper.GetTileSize(out w, out h);
            return(w);
        }
예제 #4
0
        public byte[] LoadTile(int zoom, int x, int y)
        {
            int h;
            int w;

            TMDLLWrapper.GetTileSize(out w, out h);
            byte[] imageBuf;
            int    jpgSize;
            int    buffsize = w * h * 3;

            imageBuf = new byte[buffsize];
            TMDLLWrapper.GetTileImageAsRawJPG(zoom, x, y, imageBuf, buffsize, out jpgSize);
            return(imageBuf);
        }
        public byte[] LoadTile(int zoom, int x, int y)
        {
            int h, w, jpgSize;

            byte[] imageBuf;

            //gets the size of the tile
            TMDLLWrapper.GetTileSize(out w, out h);
            int buffsize = w * h * 3;

            imageBuf = new byte[buffsize];

            //gets the raw jpg file
            TMDLLWrapper.GetTileImageAsRawJPG(zoom, x, y, imageBuf, buffsize, out jpgSize);
            return(imageBuf);
        }
예제 #6
0
        //To get the width of the tile selected
        public int GetTileWidth()
        {
            int width = 0;
            int height;

            try
            {
                TMDLLWrapper.GetTileSize(out width, out height);
            }
            //If cannot access the dll function
            catch (DllNotFoundException)
            {
                System.Console.WriteLine("Unable to serve client - Could not find the dll");
            }

            return(width);
        }
예제 #7
0
        //This methods selects the particular tile at a partcular zoom level and coordinates.
        //Then puts the image in a buffer and returns it.
        public byte[] LoadTiles(int zoom, int x, int y)
        {
            int buffSize, imgSize;
            int height = 0;
            int width  = 0;

            try
            {
                TMDLLWrapper.GetTileSize(out width, out height);
            }
            //If cannot access the dll function
            catch (DllNotFoundException)
            {
                System.Console.WriteLine("Unable to serve client - Could not find the dll");
            }

            //Overestimating buffer size to make sure it's big enough to hold tile
            buffSize = width * height * 3;

            //Creating a buffer to holf raw JPEG data
            byte[] rawJPEG = new byte[buffSize];

            try
            {
                if (TMDLLWrapper.GetTileImageAsRawJPG(zoom, x, y, rawJPEG, buffSize, out imgSize) == 0)
                {
                    System.Console.WriteLine("Possible navigation for tiles out of range detected");
                }
            }
            //If cannot access the dll function
            catch (DllNotFoundException)
            {
                System.Console.WriteLine("Unable to serve client - Could not find the dll");
            }

            return(rawJPEG);
        }