Esempio n. 1
0
    internal static Form_ImageShaper.DGVCell[] LoadProject(string filename)
    {
        List <string> cellSections = GetSections(filename);

        cellSections.RemoveAll(u => !u.Contains("Cell"));
        Form_ImageShaper.DGVCell[] cells = new Form_ImageShaper.DGVCell[cellSections.Count];
        for (int i = 0; i < cellSections.Count(); i++)
        {
            Form_ImageShaper.DGVCell cell = new Form_ImageShaper.DGVCell();
            int.TryParse(GetIniFileString(filename, cellSections[i], "ColumnIndex", ""), out cell.ColumnIndex);
            int.TryParse(GetIniFileString(filename, cellSections[i], "RowIndex", ""), out cell.RowIndex);

            string palfile = GetIniFileString(filename, cellSections[i], "FileName", "");
            int    tmp     = 0;
            int.TryParse(GetIniFileString(filename, cellSections[i], "CompressionFormat", ""), out tmp);
            SHP_TS_EncodingFormat CompressionFormat = (SHP_TS_EncodingFormat)tmp;
            tmp = 0;
            int.TryParse(GetIniFileString(filename, cellSections[i], "PaletteIndex", "0"), out tmp);
            CImageFile imf = new CImageFile(palfile, tmp, CompressionFormat);

            tmp = 0; int.TryParse(GetIniFileString(filename, cellSections[i], "BitFlags", "1"), out tmp); imf.BitFlags = (SHP_TS_BitFlags)tmp;
            bool.TryParse(GetIniFileString(filename, cellSections[i], "UseCustomBackgroundColor", ""), out imf.UseCustomBackgroundColor);
            imf.CustomBackgroundColor = String2Color(GetIniFileString(filename, cellSections[i], "CustomBackgroundColor", ""));
            bool.TryParse(GetIniFileString(filename, cellSections[i], "IsSHP", ""), out imf.IsSHP);
            tmp            = -1; int.TryParse(GetIniFileString(filename, cellSections[i], "SHPFrameNr", "-1"), out tmp); imf.SHPFrameNr = tmp;
            imf.RadarColor = String2Color(GetIniFileString(filename, cellSections[i], "RadarColor", ""));
            bool.TryParse(GetIniFileString(filename, cellSections[i], "RadarColorAverage", ""), out imf.RadarColorAverage);
            bool.TryParse(GetIniFileString(filename, cellSections[i], "CombineTransparentPixel", ""), out imf.CombineTransparentPixel);

            cell.Value = imf;
            cells[i]   = cell;
        }
        return(cells);
    }
Esempio n. 2
0
 public CImageResult(Bitmap bmp, int frameNr, SHP_TS_EncodingFormat format, SHP_TS_BitFlags bitflags, Color RadarColor, string message)
 {
     this.bmp        = bmp;
     this.frameNr    = frameNr;
     this.message    = message;
     this.format     = format;
     this.RadarColor = RadarColor;
     this.bitflags   = bitflags;
 }
Esempio n. 3
0
 public CImageFile(string file, int paletteIndex, SHP_TS_EncodingFormat CompressionFormat)
 {
     this.ImageName                = System.IO.Path.GetFileName(file);
     this.FileName                 = file;
     this.PaletteIndex             = paletteIndex;
     this.UseCustomBackgroundColor = false;
     this.CustomBackgroundColor    = Color.FromArgb(0, 0, 0);
     this.CombineTransparentPixel  = false;
     this.CompressionFormat        = CompressionFormat;
     this.IsSHP             = false;
     this.SHPFrameNr        = -1;
     this.RadarColor        = Color.FromArgb(255, 255, 255);
     this.RadarColorAverage = false;
     this.BitFlags          = SHP_TS_BitFlags.UnknownBit1;
 }
Esempio n. 4
0
 public CImageJob(string targetpath, int row_index, string framefilename, string framefileformat, List <CImageFile> imagefiles, bool CreateFrameFile, SHP_TS_EncodingFormat DefaultCompression)
 {
     this.CreateImageFile = CreateFrameFile;
     this.frameNr         = row_index;
     if (framefilename == "*")
     {
         this.tmpfilename = Path.GetFileNameWithoutExtension(imagefiles[0].FileName);
     }
     else
     {
         this.tmpfilename = framefilename + row_index.ToString("00000");
     }
     this.tmpfileformat = framefileformat;
     if (!CreateFrameFile)
     {
         this.tmpfilename = "frame" + row_index.ToString("00000");
     }
     this.outputfilename     = Path.Combine(targetpath, tmpfilename);
     this.files              = imagefiles.ToArray();
     this.DefaultCompression = DefaultCompression;
 }