hi...
i create a chat-control and use a richview to display the chatlog... with many gif animations and colored text. but ever line i add, the tastmanager show me the exe increase 5-20 kb more memory needed ?
it is possible that the richeview dont free the grafic-objects on free ? so i can use a already created grafik-object and dont must create for ever smilie a new grafik-object, yes, i assigned it, but it need too many memroy !!!!!
and yes, i use already existings styles and dont create for ever line a new style...
what can i do too, to save memory ?
greez & thx, sky...
EDIT:
and if MANY smilies displayed then i get this message:
---------------------------
XXXXXXXXXXXXXXXX
---------------------------
Leinwand/Bild erlaubt kein Zeichnen.
---------------------------
OK
---------------------------
translation: canvas dont allow to draw !
RichView need to much memory !
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
First, which version of TRichView do you use? There were some changes for more efficient using memory and resources for gif animations.
(but the latest change was related to TGifImage, TJvGifImage should be testest yet)
Next, there is a simple way to save resources for graphics, I believe it works with TJvGifImage too. When adding image in chat, copy it using Assign method instead of loading from file/stream. Copied images must share graphic data.
(but the latest change was related to TGifImage, TJvGifImage should be testest yet)
Next, there is a simple way to save resources for graphics, I believe it works with TJvGifImage too. When adding image in chat, copy it using Assign method instead of loading from file/stream. Copied images must share graphic data.
okay... big thx... i use TRichView 1.9.24 and the JEDI GIF Class...
now i have a smilie-manager... its a simple TList of TJvGifImage... and if i add a smilie, create a new TJvGifImage and assigne one of the smilies from the smilie-manager... okay... i tra to convert my smilie manager to a TList of TMemroyStream and if i add a smilie, i load the source with TJvGifImage.LoadFromStream from the smilie-manager, maybe ist works ?
greez, sky...
now i have a smilie-manager... its a simple TList of TJvGifImage... and if i add a smilie, create a new TJvGifImage and assigne one of the smilies from the smilie-manager... okay... i tra to convert my smilie manager to a TList of TMemroyStream and if i add a smilie, i load the source with TJvGifImage.LoadFromStream from the smilie-manager, maybe ist works ?
greez, sky...
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
okay... it wasnt easy, but i found it in the RV code:
Unit: RVItem
now can i use the TJvGifImage object from my smiliemanger and i dont must create a new TJvGifImage object for any smilie... but i see, the TRVGraphicItemInfo create a copy from the input Grafik:
it is possible to work without this copy ? and i must say i have the version:
1.9.15.1
maybe you can give me some tips ?
greez & thx, sky...
Unit: RVItem
Code: Select all
destructor TRVGraphicItemInfo.Destroy;
begin
// Image.Free; <--- just kill this
ImageCopy.Free;
{$IFNDEF RVDONOTUSEANIMATION}
FAnimator.Free;
{$ENDIF}
inherited Destroy;
end;
Code: Select all
ImageCopy.Free;
1.9.15.1
maybe you can give me some tips ?
greez & thx, sky...
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
ImageCopy is created only in 256-color mode. This is a bitmap converted to some palette. It does not make too much sense now, because new versions of Windows do not support 256-color resolution.
Memory and resources are used not only for storing image, but also for storing animator (FAnimator). Please upgrade to v1.9.24 or newer, it uses resources for animator much more effectively.
Memory and resources are used not only for storing image, but also for storing animator (FAnimator). Please upgrade to v1.9.24 or newer, it uses resources for animator much more effectively.