Good morning. I have found the code which is causing the problem. For a MIO DoPrintPreviewDialog is calling a form of class "TfiePrnForm3". This form has a FormActivate event handler which is loading the pics of the org. MIO (srcview) into a temp MIO (ImageEnMView1). After confirming the exception dialog the image count of the MIO on the left side of the "TfiePrnForm3"-dialog was increased by one. So the MIO must have refilled by the FormActivate event. So simply fix for me was by clearing the temp MIO. Don't know if it is the correct fix.
procedure TfiePrnForm3.FormActivate(Sender: TObject);
var
i, idx: integer;
begin
Screen.Cursor := crHourglass;
try
Application.ProcessMessages; // first draws all controls (to avoid "Swiss Cheese")
ImageEnMView1.Clear; //fix add by myself
ImageEnMView1.LockUpdate;
fActivating := true;
if IEGlobalSettings().UseButtonGlyphsInDialogs = False then
begin
btnPrint.Glyph := nil;
btnSetup.Glyph := nil;
btnCancel.Glyph := nil;
cmbPosition.Style := csDropDownList;
end;
fOriginalDlgWidth := ClientWidth;
fOriginalDlgHeight := ClientHeight;
LoadParameters;
ImageEnMView1.FillThumbnail := false;
ImageEnMView1.SetModernStyling;
ImageEnMView1.SideGap := 6;
ImageEnMView1.Background := clBtnFace;
ImageEnMView1.GradientEndColor := clGray;
ImageEnMView1.ThumbnailDisplayFilter := rfLanczos3;
ImageEnMView1.ThumbnailsBorderColor := clSilver;
// load ImageEnMView1
srcview := mio.AttachedMView as TImageEnMView;
for i := 0 to srcview.ImageCount - 1 do
begin
idx := ImageEnMView1.AppendImage;
ImageEnMView1.SetIEBitmapEx(idx, srcview.GetTIEBitmap(i));
srcview.ReleaseBitmap(idx, false); // list index error is thrown here
if srcview.ImageTopText[i] <> '' then
ImageEnMView1.ImageTopText[idx] := srcview.ImageTopText[i]
else
if srcview.ImageBottomText[i] <> '' then
ImageEnMView1.ImageTopText[idx] := srcview.ImageBottomText[i]
else
ImageEnMView1.ImageTopText[idx] := 'Image ' + IntToStr(i + 1);
if PrintAnnotations then
ImageEnMView1.MIO.Params[idx].Assign( srcview.MIO.Params[i] );
end;
ImageEnMView1.SelectedImage := 0;
// Get our selection from the source
if srcview.MultiSelectedImagesCount > 0 then
ImageEnMView1.CopySelection(srcview);
cmbPrintSelector.ItemIndex := 0;
fActivating := false;
ImageSelect;
SetLanguage_units;
finally
ImageEnMView1.UnlockUpdate;
Screen.Cursor := crDefault;
end;
end;
greetings.
madas