Beispiel #1
0
 public LoadBitmapDataBack(string bmpdatapath, int _activefloorid, subject _activesubject)
 {
     // TODO: Complete member initialization
     this.bmpdatapath    = bmpdatapath;
     this._activefloorid = _activefloorid;
     this._activesubject = _activesubject;
 }
Beispiel #2
0
 public LoadBitmapDataBack(string bmpdatapath, int floorid, List <subject> sublist)
 {
     this.floorid     = floorid;
     this.bmpdatapath = bmpdatapath;
     this.sublist     = sublist;
     this.activesj    = null;
     bs = null;
     fs = null;
     Init();
     buffer = new byte[102400];
 }
Beispiel #3
0
        public bool SetActiveSubject(subject activesj)
        {
            if (!sublist.Contains(activesj))
            {
                return(false);
            }
            if (this.activesj == null || this.activesj != activesj)
            {
                if (this.activesj != null)
                {
                    if (bs != null || fs != null)
                    {
                        bs.Flush();
                        bs.Close();
                        //						fs.Flush();
                        ms.Close();
                        fs.Close();
                        ms = null;
                    }
                }
                string imgdatafilename = bmpdatapath + "roomdata_[roomid].datagz".Replace("[roomid]", "");
                fs = new FileStream(imgdatafilename, FileMode.Open, FileAccess.Read);

                using (GZipStream gzs = new GZipStream(fs, CompressionMode.Decompress))
                {
                    ms = new MemoryStream();
                    byte[] bu     = new byte[4096];
                    int    actual = 0;
                    do
                    {
                        actual = gzs.Read(bu, 0, 4096);
                        ms.Write(bu, 0, actual);
                    } while (actual > 0);
                }
                bs            = new BufferedStream(ms, 512000);
                this.activesj = activesj;
            }
            else if (this.activesj == activesj)
            {
                // donothing
            }
            return(true);
        }
 private Rectangle DetectFeatureRect(subject sub, Bitmap src = null)
 {
     return(DetectFeatureRect(sub.Rect, src));
 }