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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnMView upgrade
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - Oct 03 2016 :  21:17:17  Show Profile  Reply
I upgraded an old version of ImageEn to the latest but some of the properties are no longer available. What is the best way to modify the following code:

ImageEnMView1.ImageBottomText[ idx ].Background:=clYellow;
ImageEnMView1.ImageBottomText[ idx ].Font.Name := 'Arial Unicode MS';
ImageEnMView1.ImageBottomText[ idx ].Font.Size := 8;
ImageEnMView1.ImageBottomText[ idx ].Font.Style := [];
ImageEnMView1.ImageBottomText[ idx ].Font.Color:=clBlue;

Thanks in advance.

Andy

AndyColmes

USA
351 Posts

Posted - Oct 04 2016 :  00:57:13  Show Profile  Reply
I think I have to use OnGetTextEx event to use TextBackgroundColor and TextBottomFont.
Go to Top of Page

xequte

38615 Posts

Posted - Oct 04 2016 :  02:53:52  Show Profile  Reply
Yes, please see the examples at:

http://www.imageen.com/help/TImageEnMView.OnGetTextEx.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Oct 11 2016 :  11:11:49  Show Profile  Reply
Hi Nigel,

I must be missing something. I am manually inserting images to a TImageEnMView using SetIEBitmapEx. I am also defining each item by its ImageTag, hoping to have a different text color and background depending on the ImageTag value. But my whole application freezes when I do that. Where did I go wrong with the following OnGetTextEx code?

Thanks Nigel and sorry for being thick.

Andy



procedure TCompareForm.ImageEnMView1GetTextEx(Sender: TObject; Index: Integer;
  Position: TIEMTextPos; var Text: WideString; Font: TFont;
  var BackgroundStyle: TBrushStyle; var BackgroundColor: TColor;
  var TruncSide: TIEMTruncSide);
begin
  ImageEnMView1.BottomTextFont.Name := 'Arial Unicode MS';
  ImageEnMView1.BottomTextFont.Size := 8;
  ImageEnMView1.BottomTextFont.Style := [];

  if (ImageEnMView1.ImageTag[ Index ] = 0) then begin

    ImageEnMView1.TextBackgroundColor := clBtnFace;
    ImageEnMView1.BottomTextFont.Color:=clBlack;

  end else if (ImageEnMView1.ImageTag[ Index ] = 1) then begin

   ImageEnMView1.TextBackgroundColor := clYellow;
   ImageEnMView1.BottomTextFont.Color:=clBlue;

  end else if (ImageEnMView1.ImageTag[ Index ] = 2) then begin

   ImageEnMView1.TextBackgroundColor := clRed;
   ImageEnMView1.BottomTextFont.Color:=clWhite;

  end else if (ImageEnMView1.ImageTag[ Index ] = 3) then begin

   ImageEnMView1.TextBackgroundColor := clBlue;
   ImageEnMView1.BottomTextFont.Color:=clWhite;

  end;
  ImageEnMView1.Update;

end;
Go to Top of Page

xequte

38615 Posts

Posted - Oct 12 2016 :  02:19:23  Show Profile  Reply
Hi Andy

You are changing component properties in a paint event, which causes it to repaint, where you set component properties, which causes it to paint...

Instead of ImageEnMView1.TextBackgroundColor use BackgroundColor.
Instead of ImageEnMView1.BottomTextFont use Font.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Oct 15 2016 :  08:19:25  Show Profile  Reply
Thanks Nigel. I will give it a try.

Andy
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: