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 and memory size

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Ulrich Kobsa
Guest





PostPosted: Wed Sep 13, 2006 5:53 pm    Post subject: TJPEGImage and memory size Reply with quote



Hi,

I need to store some TJPEGImages in a buffer with a maximal capacity of
n byte (n = 20MB in my case). So how can I get the real size in memory
of a TJPEGImage? I need this to calculate if the buffer capacity is
exceeded.

Thanks,
Ulrich
Back to top
Lord Crc
Guest





PostPosted: Wed Sep 13, 2006 8:43 pm    Post subject: Re: TJPEGImage and memory size Reply with quote



On 13 Sep 2006 05:53:48 -0700, "Ulrich Kobsa"
<ulrich.kobsa@t-online.de> wrote:

Quote:
So how can I get the real size in memory
of a TJPEGImage? I need this to calculate if the buffer capacity is
exceeded.

If you need the compressed size, you'll have to compress it. One way
of doing that is to save it to a TMemoryStream (I assume you don't
have the image on disk already). If you want the uncompressed size,
just use "memsize:= width*height*3;"

- Asbjørn
Back to top
Robert
Guest





PostPosted: Wed Sep 13, 2006 10:02 pm    Post subject: Re: TJPEGImage and memory size Reply with quote



Hi,
the only way i found was to save the image in a MemoryStream:
JPG.SaveToStream(Stream)
then you can get the size from the stream:
Stream.Size

Robert

Lord Crc schrieb:
Quote:
On 13 Sep 2006 05:53:48 -0700, "Ulrich Kobsa"
ulrich.kobsa@t-online.de> wrote:

So how can I get the real size in memory
of a TJPEGImage? I need this to calculate if the buffer capacity is
exceeded.

If you need the compressed size, you'll have to compress it. One way
of doing that is to save it to a TMemoryStream (I assume you don't
have the image on disk already). If you want the uncompressed size,
just use "memsize:= width*height*3;"

- Asbjørn
Back to top
Ulrich Kobsa
Guest





PostPosted: Thu Sep 14, 2006 8:11 am    Post subject: Re: TJPEGImage and memory size Reply with quote

Thanks for your help!

greetings,
Ulrich
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi 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.