ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 DoPrintPreviewDialog

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
naser123 Posted - Apr 05 2015 : 08:19:41
When I change the print setup Orientation, system take an error:
list index out of bounds(10) that 10 is count of image into the imaeenmview component.

12   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 28 2016 : 17:39:54
Thanks, I'll add some code to prevent double calls to FormActivate (which unfortunately are inherently risky, and only exist for historical reasons).


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
madas Posted - Mar 23 2016 : 05:42:44
Have tried it with the 6.2.2 version. Problem still exists within my application. But now the funny part. If i create a new project with only one TImageEnMView attached to the form and doing the same as in the other project then i don't get this error. Here the FormActivate event isn't fired again after coming back from the printer setup dialog. :( Strange.
madas Posted - Mar 23 2016 : 05:01:27
Hi Nigel,

just after the form "TfiePrnForm3" is created all is fine. The count of thumbs in the left pane MIO is exactly the same as of the MIO from which the method "DoPrintPreviewDialog" was called. And the FormActivate was called once. But if you click on the "printer setup" button within the preview form and coming back from the setup dialog the preview form becomes active again and so the FormActivate event is fired again and the event handler is trying to add the pics of the original MIO to the temp MIO for the second time. :( So ReleaseBitmap is called with a wrong index.

But i will have a look at the 6.2.2 release.

greetings.

madas
xequte Posted - Mar 22 2016 : 17:43:22
Hi

I'm afraid i cannot reproduce this in v6.2.2. Also, the code looks like to be correct. Clear should have no effect in FormActivate because the ImageEnMView should already be empty (form has just been created).

Can you please test in 6.2.2, and if you can still reproduce give me the exact steps to take.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
madas Posted - Mar 22 2016 : 02:07:37
and btw.: then using the procedure ShowWindowsPrintWizard(ImageEnMView: TImageEnMView; bAllImages: Boolean); overload; of the iexWindowsFunctions the image count is twice as high as expected too. :(
madas Posted - Mar 22 2016 : 02:05:17
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
madas Posted - Mar 22 2016 : 01:09:04
I will have a look within one of the demos.

regards.

madas
xequte Posted - Mar 21 2016 : 14:04:21
Hi

Can you reproduce it in any of our demos? (perhaps by adding a little code)

If so, please advise the steps to reproduce it.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
madas Posted - Mar 21 2016 : 09:46:53
I am getting the same error when using DoPrintPreviewDialog on a TImageEnMIO with a multi-page tiff loaded. The error occurs after clicking Ok or Cancel in the printer setup dialog.

Version used 6.2.0.0
xequte Posted - Apr 06 2015 : 03:08:27
Hi

I think it is an issue in the version you are using. Email us to see what newer versions you are entitled to, or extend your registration at:

http://www.imageen.com/order/

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
naser123 Posted - Apr 06 2015 : 01:47:10
4.1.4
xequte Posted - Apr 05 2015 : 10:21:22
Hi

What version of ImageEn are you using?


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com