Freeing memory from a label preview when inserting images

  • I am currently working on a Labeling program in Delphi 7 and am using your wpForm component, the problem that I am having is that
    I am using 2 wpFormEditor controls, one for the label designer and one for the preview (they are both on the same form).

    After the label design is finished I output the report page by page, first creating a file and then using the write page method. (see below)

    Code
    if  WPFReportEngine2.ReportLoaded then		      WPFReportEngine2.Close;		//Create the report file to append each page to		      WPFReportEngine2.CreateFile(installpath+'\selfit\Import\PrntPreview.wpr');		 for i := 0 to (EndBadgeNo-StartBadgeNo) do		Begin		      WPFReportEngine2.WritePage(i);		end;


    This all works fine I then load the report into the 2nd wpfFormEditor control (using the execute procedure below) and set it up like a preview


    This also works fine, the problem is that when I put an image on the label thatI am designing and preview the report in this way (say for 200 labels)
    a lot of memory is used up (this depends on the size of the image that has been inserted) and I can find no way to free up the used memory??
    I have tried loading in a blank report but this doesn't help and everytime I preview the report I lose more and more memory. As the 2nd preview
    formEditor is on the same form as the designer and is linked throughout the program (nearing the end of the project) I cannot create and destroy it
    at runtime,

    I would be very greatful if someone could help with any suggestions to this problem

    many thanks

    David Niziol