Does trichview support a fade-in & fade-out text?
thx in advance
support fade in and fade out?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sorry, no.
But you can create image of TRichView document, place it on top of TRichView, and apply fade-in/fade-out effect to this image.
I created a demo: http://www.trichview.com/support/files/fade.zip
But if you need to apply this effect to text only (not to pictures, tables, etc.), and if this text is on the same background, you simply can modify RVStyle.TextStyles.Color (for all i) and repaint TRichView.
But you can create image of TRichView document, place it on top of TRichView, and apply fade-in/fade-out effect to this image.
I created a demo: http://www.trichview.com/support/files/fade.zip
But if you need to apply this effect to text only (not to pictures, tables, etc.), and if this text is on the same background, you simply can modify RVStyle.TextStyles.Color (for all i) and repaint TRichView.
That's great.Sergey Tkachenko wrote:Sorry, no.
But you can create image of TRichView document, place it on top of TRichView, and apply fade-in/fade-out effect to this image.
I created a demo: http://www.trichview.com/support/files/fade.zip
But if you need to apply this effect to text only (not to pictures, tables, etc.), and if this text is on the same background, you simply can modify RVStyle.TextStyles.Color (for all i) and repaint TRichView.
I only want to fade-in/fade-out line 2 (only text), but merely change the style can make a transparency effect? I try but seems not good
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks. I am not quite familiar with controling color, here is my code of handling TEXT in green on black background (change the brightness from bright to dark)Sergey Tkachenko wrote:If the background is a plain color (for example, white), you can make text color whiter and whiter, until it becomes white and completely disappears.
RVEdit.Clear;
RVEdit.AddNL('text', 0, 0);
RV.Format;
cColor := clBlack;
ccColor := Self.AnsRVStyle.TextStyles.Items[0].Color;
for i := 10 downto 0 do
begin
Level := 255*i div 10;
blue := ((cColor and $FF00FF) shr 16)*Level;
green := ((cColor and $00FFFF) shr *Level;
red := (cColor and $0000FF)*Level;
Lev := 255-Level;
cBlue := ((ccColor and $FF00FF) shr 16)*Level;
cGreen := ((ccColor and $00FFFF) shr *Level;
cRed := (ccColor and $0000FF)*Level;
cBlue := (cBlue *Lev + blue) div 255;
cGreen := (cGreen*Lev + green) div 255;
cRed := (cRed *Lev + red) div 255;
ccColor := cBlue*255*255 + cGreen*255 + cRed;
Self.AnsRVStyle.TextStyles.Items[0].Color := ccColor;
Sleep(100);
end;
But the it doesn't change the brightness smoothly and Sleep here seems block the program seriously while clicking other other buttons before the loop is finished. By the way, is it possible to make a specific line being fade-in/out rather than working on the whole richview?
Thanks in advance.