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
 ImageTopText/ImageInfoText/ImageBottomText in v6
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

xequte

38615 Posts

Posted - Mar 14 2015 :  15:34:51  Show Profile  Reply
In v6.0.0 we have made a number of change to TImageEnMView to improve memory and resource usage. One in particular was overhauling the text handling. In prior versions TImageEnMView required three font objects for every frame (which was fine in 2002, but much less so in 2015 where a folder may contain tens of thousands of images).

Unfortunately this may means some changes for upgraders.

Fonts are now set on a global basis, so rather than setting:

ImageTopText[idx].Font use TopTextFont once
ImageInfoText[idx].Font use InfoTextFont once
ImageBottomText[idx].Font use BottomTextFont once

(If you need to customize the fonts for particular cells - and I have not heard of this being used - use TImageEnMView.OnGetTextEx instead)


Also text objects are now strings rather than classes so replace all references to

ImageTopText[idx].Caption with ImageTopText[idx]
ImageInfoText[idx].Caption with ImageInfoText[idx]
ImageBottomText[idx].Caption with ImageBottomText[idx]

(i.e. just remove the ".Caption")


For other changes, please see the compatibility notes at the end of:

http://www.imageen.com/info/HistoryFull.html#6.0.0

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

xequte

38615 Posts

Posted - Apr 06 2015 :  03:14:03  Show Profile  Reply
Hi

If you need to customize the styling of individual cells see the examples at:

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

Old code:
ImageEnMView1.ImageTopText[ n ].Background := clYellow;


New code:
procedure TForm1.IEFolderMViewGetTextEx(Sender: TObject; Index: Integer; Position: TIEMTextPos; var Text: WideString;
                                        Font : TFont; var BackgroundStyle: TBrushStyle; var BackgroundColor: TColor;
                                        var TruncSide: TIEMTruncSide);
begin
  If ShouldHighlightThumb( Index ) then
    BackgroundColor := clYellow;
end;




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

xequte

38615 Posts

Posted - Jun 30 2015 :  15:31:25  Show Profile  Reply
Hi

Another way to do the preceding would be to make use of the ImageTag or ImageUserPointer properties.

http://www.imageen.com/help/TImageEnMView.ImageTag.html
http://www.imageen.com/help/TImageEnMView.ImageUserPointer.html

To point to an entry in TList, Database, etc.

If you only need to store one color then simply use ImageTag as a color:


Appending:

  idx := AppendImage( SomeFile );
  If ShouldHighlightThumb( SomeFile ) then
    ImageEnMView1.ImageTag[ idx ] := Integer( clYellow )
  else
    ImageEnMView1.ImageTag[ idx ] := Integer( clWindowText );


Setting color:
procedure TForm1.IEFolderMViewGetTextEx(Sender: TObject; Index: Integer; Position: TIEMTextPos; var Text: WideString;
                                        Font : TFont; var BackgroundStyle: TBrushStyle; var BackgroundColor: TColor;
                                        var TruncSide: TIEMTruncSide);
begin
  BackgroundColor := TColor( ImageEnMView1.ImageTag[ Index] );
end;




Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: