Пример #1
0
 /***********************************************************************************************************************/
 /// <summary>
 /// Used to set a bmp image for the path map
 /// </summary>
 public void SetMap(BMP24Bit bitmap)
 {
     mWidth         = (uint)bitmap.Width;
     mHeight        = (uint)bitmap.Height;
     mColorArray    = new uint[mHeight, mWidth];
     mDistanceArray = new uint[mHeight, mWidth];
     mBitmap        = bitmap;
 }
Пример #2
0
    /// <summary>
    /// Used to save path to bitmap
    /// </summary>
    public void SavePathToBitmap(string filename, PathImage pathImage)
    {
        // Genrates bitmap
        BMP24Bit bitmap = new BMP24Bit(mWidth, mHeight);

        // Sets bitmap data to the specified path image
        switch (pathImage)
        {
        case PathImage.ColorImage:
            bitmap.BitmapArray = mColorArray;
            break;

        case PathImage.WaveImage:
            bitmap.BitmapArray = mDistanceArray;
            break;
        }

        // Saves bitmap
        bitmap.Export(filename);
    }
Пример #3
0
 /// <summary>
 /// Calls SetMap with bitmap
 /// </summary>
 public PathFinding(BMP24Bit bitmap)
 {
     SetMap(bitmap);
 }