How saving Tatdiagram to a DataBase?

Hello experts
I am using DiagramStudio version 4.8.

  1. How can I save all the Tatdiagram1 with its contents into a bitmap or Timage???
  2. I also need to save Tatdiagram1 to a database then getting it back to Tatdiagram1 component.
    Please your assistance!!
    Thank you in advance

To save it as a bitmap, you can use the following methods:

    ///  <summary>
    ///    Export the current diagram to file as a BMP image.
    ///  </summary>
    procedure ExportAsBMP(const fileName : String; exportSize : TExportSize = esCentered);

    ///  <summary>
    ///    Export the current diagram to file as a PNG image.
    ///  </summary>
    {$IFDEF DELPHI2009_LVL}
    procedure ExportAsPNG(const fileName : String; exportSize : TExportSize = esCentered);
    {$ENDIF}

    ///  <summary>
    ///    Export the current diagram to a stream as a BMP image.
    ///  </summary>
    procedure ExportAsBMPStream(AStream: TStream; exportSize : TExportSize = esCentered);

To save to database, you can save/load to a stream and then save the stream content in a database blob:

    ///  <summary>
    ///    Save current diagram the stream specified by AStream.
    ///  </summary>
    procedure SaveToStream(AStream: TStream; TextFormat: boolean = false); virtual;

    ///  <summary>
    ///    Load diagram from the stream specified by AStream.
    ///  </summary>
    procedure LoadFromStream(AStream: TStream; TextFormat: boolean = false); virtual;