Persisting a Font Object

  • Thread starter Thread starter David Pendleton
  • Start date Start date
D

David Pendleton

Hello all.

Does anyone know how to persist or serialize a Font object? Possible?

Thanks.
 
Yes, possible.
Use either the BinaryFormatter class to serialize the object into a byte
array.
You can then write the bytes to disk, or stream them out to wherever you
need them.
The BinaryFormatter will then be able to take the bytes and reconstitute
your font instance elsewhere.

-Rob Teixeira [MVP]
 
Thanks for the advice. I followed your advice and it worked well.

Now, my question is this: how do you persist (and restore) more than one
object per file?

Thanks again, your advice was very helpful.

Dave
 
Back
Top