/// <summary> /// Loads signature data that was written using the Save method from a data stream. /// </summary> /// <param name="stream">The data stream to read from</param> /// <returns>A Signature object created from the data.</returns> static public Signature Load(Stream stream) { BinaryReader r = new BinaryReader(stream); int dc = r.ReadInt32(); SignatureData *data = stackalloc SignatureData[dc]; for (int i = 0; i < dc; ++i) { data[i] = new SignatureData(r.ReadDouble(), r.ReadDouble(), r.ReadDouble(), r.ReadUInt64(), r.ReadDouble(), r.ReadDouble(), r.ReadUInt64(), r.ReadDouble(), new Point(r.ReadDouble(), r.ReadDouble()), new Point(r.ReadDouble(), r.ReadDouble())); } return(new Signature(data, dc)); }
/// <summary> /// Wipes all signature data from memory. NOTE: does not wipe data stored outside of the signature object, for example in a data stream. /// </summary> public void Dispose() { for (int i = 0; i < _c; ++i) { _[i].AngleChange = 0; _[i].AngleWobble = 0; _[i].Length = 0; _[i].PressureChange = 0; _[i].PressureWobble = 0; _[i].StartingAngle = 0; _[i].StartingPressure = 0; _[i].TimeOffset = 0; _[i].Start.X = 0; _[i].Start.Y = 0; _[i].End.X = 0; _[i].End.Y = 0; } _c = 0; _ = null; }
internal Signature(SignatureData *data, int count) { _ = data; _c = count; }