BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TJPEGImage; can I dispose the interal BMP-buffer?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
wwwim
Guest





PostPosted: Tue Jan 20, 2004 9:42 pm    Post subject: TJPEGImage; can I dispose the interal BMP-buffer? Reply with quote



Hi,

I programmed an image viewer. It read some 300 JPEG images in a list of
TJPEGImage objects. This hardly uses memory, each jpeg file is about 20
kbyte. However, if I draw the jpeg objects to an TImage in my form, I see
the amount of memory used grows to over 150 Megabyte. I tried deleting the
TImage and creating a new one for each jpeg-image, but it didn't help.

I discovered that TJPEGImage has an internal buffer in which it keeps the
bitmap of the image. I could not discover a way to remove this buf. I would
rather have the PC again decode the jpeg to a bmp than using this huge
amount of memory.

Any solutions for this?
Thank you!


Back to top
Hans Galema
Guest





PostPosted: Wed Jan 21, 2004 8:08 am    Post subject: Re: TJPEGImage; can I dispose the interal BMP-buffer? Reply with quote



wwwim wrote:

Quote:
I discovered that TJPEGImage has an internal buffer in which it keeps the
bitmap of the image. I could not discover a way to remove this buf.

Why would you remove the buf of the TJPEGIMage ? First you said that
it occupied hardly any memory. Or did I miss something. Did you tell
that with assigning it to a TImage that internal bujffer first grew ?

And if you cannot remove that buf separately you could still delete the
TJPEGIMage instance itself?

Please explain.

Hans.

Back to top
Detlef
Guest





PostPosted: Wed Jan 21, 2004 8:24 am    Post subject: Re: TJPEGImage; can I dispose the interal BMP-buffer? Reply with quote



I think JPEG is a compressing algorithm. If you expand this ( writing to an
image) it will use more memory. The only solution for this is not to show
all images.
Detlef

"wwwim" <wbardoelREMOVEUPPERCASE (AT) yahoo (DOT) com> schrieb im Newsbeitrag
news:400da0bf (AT) newsgroups (DOT) borland.com...
Quote:
Hi,

I programmed an image viewer. It read some 300 JPEG images in a list of
TJPEGImage objects. This hardly uses memory, each jpeg file is about 20
kbyte. However, if I draw the jpeg objects to an TImage in my form, I see
the amount of memory used grows to over 150 Megabyte. I tried deleting the
TImage and creating a new one for each jpeg-image, but it didn't help.

I discovered that TJPEGImage has an internal buffer in which it keeps the
bitmap of the image. I could not discover a way to remove this buf. I
would
rather have the PC again decode the jpeg to a bmp than using this huge
amount of memory.

Any solutions for this?
Thank you!





Back to top
wwwim
Guest





PostPosted: Wed Jan 21, 2004 7:06 pm    Post subject: Re: TJPEGImage; can I dispose the interal BMP-buffer? Reply with quote

Sorry for not being completely clear in what I want to achieve (although you
guessed it quite well!)

Indeed, my conclusion is that as soon as you assign a TJPEGImage to an
TImage, the size of TJPEGImage grows. As far as I understood from other
postings, this is due to an internal buffer in which it decodes the jpeg to
a bitmap.
I want to display only one image at a time, and want to be able to quickly
and randomly switch between images. I use only one TImage to display the
jpeg. I prefer not to use the harddisk and because the jpegs are roughtly
20 - 40k Byte each, I thought this would not be a problem. However, due to
the internal buf in TJPEGImage, at the time I've seen all images, all
internal buffs are filled and they total to 200MByte for some 300 jpeg
images!



"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote

Quote:
wwwim wrote:

I discovered that TJPEGImage has an internal buffer in which it keeps
the
bitmap of the image. I could not discover a way to remove this buf.

Why would you remove the buf of the TJPEGIMage ? First you said that
it occupied hardly any memory. Or did I miss something. Did you tell
that with assigning it to a TImage that internal bujffer first grew ?

And if you cannot remove that buf separately you could still delete the
TJPEGIMage instance itself?

Please explain.

Hans.
"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote


Quote:
wwwim wrote:

I discovered that TJPEGImage has an internal buffer in which it keeps
the
bitmap of the image. I could not discover a way to remove this buf.

Why would you remove the buf of the TJPEGIMage ? First you said that
it occupied hardly any memory. Or did I miss something. Did you tell
that with assigning it to a TImage that internal bujffer first grew ?

And if you cannot remove that buf separately you could still delete the
TJPEGIMage instance itself?

Please explain.

Hans.



Back to top
wwwim
Guest





PostPosted: Wed Jan 21, 2004 7:08 pm    Post subject: Re: TJPEGImage; can I dispose the interal BMP-buffer? Reply with quote

Hi Detlef,

Even if you don't show all images (which I don't do, I display only one) it
will use a lot of memory,

You can see more details in my reply to Hans Galema,

Wim


"Detlef" <detlef.stute (AT) seatec-gmbh (DOT) com> wrote

Quote:
I think JPEG is a compressing algorithm. If you expand this ( writing to
an
image) it will use more memory. The only solution for this is not to show
all images.
Detlef

"wwwim" <wbardoelREMOVEUPPERCASE (AT) yahoo (DOT) com> schrieb im Newsbeitrag
news:400da0bf (AT) newsgroups (DOT) borland.com...
Hi,

I programmed an image viewer. It read some 300 JPEG images in a list of
TJPEGImage objects. This hardly uses memory, each jpeg file is about 20
kbyte. However, if I draw the jpeg objects to an TImage in my form, I
see
the amount of memory used grows to over 150 Megabyte. I tried deleting
the
TImage and creating a new one for each jpeg-image, but it didn't help.

I discovered that TJPEGImage has an internal buffer in which it keeps
the
bitmap of the image. I could not discover a way to remove this buf. I
would
rather have the PC again decode the jpeg to a bmp than using this huge
amount of memory.

Any solutions for this?
Thank you!







Back to top
Hans Galema
Guest





PostPosted: Wed Jan 21, 2004 7:22 pm    Post subject: Re: TJPEGImage; can I dispose the interal BMP-buffer? Reply with quote

wwwim wrote:

Quote:
I want to display only one image at a time, and want to be able to quickly
and randomly switch between images. I use only one TImage to display the
jpeg. I prefer not to use the harddisk and because the jpegs are roughtly
20 - 40k Byte each, I thought this would not be a problem. However, due to
the internal buf in TJPEGImage, at the time I've seen all images, all
internal buffs are filled and they total to 200MByte for some 300 jpeg
images!

Then I suggest to add one TJPEGImage instance (named JPEGexpander) more.
If you need a specific jpg then first assign it from the
unexpanded TJPEGImage instance to JPEGexpander.

Then from the JPEGexpander assign it to the TImage.

Please report if this works.

Hans.

Back to top
wwwim
Guest





PostPosted: Wed Jan 21, 2004 7:37 pm    Post subject: Re: TJPEGImage; can I dispose the interal BMP-buffer? Reply with quote

Yep, It works. Ignored to carefully read the help on Assign. It states
clearly that one can a assign a TJPEGImage to another TJPEGImage.

Goed gedaan Hans!

"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote

Quote:
wwwim wrote:

I want to display only one image at a time, and want to be able to
quickly
and randomly switch between images. I use only one TImage to display
the
jpeg. I prefer not to use the harddisk and because the jpegs are
roughtly
20 - 40k Byte each, I thought this would not be a problem. However, due
to
the internal buf in TJPEGImage, at the time I've seen all images, all
internal buffs are filled and they total to 200MByte for some 300 jpeg
images!

Then I suggest to add one TJPEGImage instance (named JPEGexpander) more.
If you need a specific jpg then first assign it from the
unexpanded TJPEGImage instance to JPEGexpander.

Then from the JPEGexpander assign it to the TImage.

Please report if this works.

Hans.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.