private StciIndexedSubImage LoadSubImage(Ja2Data.StciSubImage aStciSubImage) { StciIndexedSubImage _subImage = new StciIndexedSubImage(); if (aStciSubImage.AuxData != null) { AuxObjectData _auxData = this.LoadAuxData(aStciSubImage.AuxData); _subImage.AuxObjectData = _auxData; base.FAuxData.Add(_auxData); } UnstructuredData _data = new UnstructuredData(); _data.Data = aStciSubImage.ImageData; _data.UserId = this.FUserId; _data.DateCreated = DateTime.Now; this.FUnstructuredData.Add(_data); _subImage.UnstructuredData = _data; _subImage.DataLength = aStciSubImage.Header.DataLength; _subImage.DataOffset = aStciSubImage.Header.DataOffset; _subImage.Height = aStciSubImage.Header.Height; _subImage.OffsetX = aStciSubImage.Header.OffsetX; _subImage.OffsetY = aStciSubImage.Header.OffsetY; _subImage.Width = aStciSubImage.Header.Width; _subImage.DateCreated = DateTime.Now; _subImage.UserId = this.FUserId; return(_subImage); }
private StciRgb LoadStciRgb(BinaryReader aReader, Ja2Data.StciHeader aHeader) { StciRgb _newStciRgb = new StciRgb(); Ja2Data.StciRgb _stciRgb = new Ja2Data.StciRgb(aHeader); Ja2Data.StciRgbHeader _subHeader = (Ja2Data.StciRgbHeader)_stciRgb.Header.SubHeader; _newStciRgb.AlphaDepth = _subHeader.AlphaDepth; _newStciRgb.AlphaMask = (int)_subHeader.AlphaMask; _newStciRgb.BlueDepth = _subHeader.BlueDepth; _newStciRgb.BlueMask = (int)_subHeader.BlueMask; _newStciRgb.GreenDepth = _subHeader.GreenDepth; _newStciRgb.GreenMask = (int)_subHeader.GreenMask; _newStciRgb.RedDepth = _subHeader.RedDepth; _newStciRgb.RedMask = (int)_subHeader.RedMask; _newStciRgb.DateCreated = DateTime.Now; _newStciRgb.UserId = this.FUserId; int _imageSize = (int)_stciRgb.Header.OriginalImageSize; UnstructuredData _data = new UnstructuredData(); _data.Data = aReader.ReadBytes(_imageSize); _data.UserId = this.FUserId; _data.DateCreated = DateTime.Now; this.FUnstructuredData.Add(_data); _newStciRgb.UnstructuredData = _data; return(_newStciRgb); }
public override int Upload(BinaryReader aReader, int aSlfFileId) { int _count = 0; foreach (Ja2Data.SlfFile.Record _file in this.FFiles) { try { aReader.BaseStream.Position = _file.Offset; SlfRecord _slfRec = new SlfRecord(); UnstructuredData _data = new UnstructuredData(); _data.Data = aReader.ReadBytes((int)_file.Length); _data.UserId = this.FUserId; _data.DateCreated = DateTime.Now; this.FUnstructuredData.Add(_data); _slfRec.UnstructuredData = _data; _slfRec.SlfFileId = aSlfFileId; SlfRecordHeader _recHeader = base.CreateSlfRecordHeader(_file); base.FHeaders.Add(_recHeader); _slfRec.SlfRecordHeader = _recHeader; _slfRec.ID = _file.FileNameExtention; _slfRec.UserId = this.FUserId; _slfRec.DateCreated = DateTime.Now; this.FSlfRecords.Add(_slfRec); this.AddRecordsToDataSet(); _count += this.SaveChanges(); } catch (Exception _exc) { string _excMess = String.Format("Uploading file {0} exception\n", _file.FileName); throw new Exception(_excMess, _exc); } } return(_count); }