public void SerializeCheck() { if (modelXLDCont != null && modelXLDCont.IsInitialized()) { modelXLDCont.Dispose(); } if (modelXLDContAffine != null && modelXLDContAffine.IsInitialized()) { modelXLDContAffine.Dispose(); } modelXLDCont = null; modelXLDContAffine = null; if (hShapeModel != null && !hShapeModel.IsInitialized()) { hShapeModel = null; } if (modelRegion != null && !modelRegion.IsInitialized()) { modelRegion = null; } using (Stream objectStream = new MemoryStream()) { System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); formatter.Serialize(objectStream, this); } }
public void SetModelOrigin(double row, double col) { if (shapeModel != null && shapeModel.IsInitialized() && ModelRegion != null && ModelRegion.IsInitialized()) { shapeModel.SetShapeModelOrigin(row - ModelRegion.Row, col - ModelRegion.Column); ModelImgRow = (float)row; ModelImgCol = (float)col; } }