 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ulrich Kobsa Guest
|
Posted: Wed Sep 13, 2006 5:53 pm Post subject: TJPEGImage and memory size |
|
|
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
|
Posted: Wed Sep 13, 2006 8:43 pm Post subject: Re: TJPEGImage and memory size |
|
|
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
|
Posted: Wed Sep 13, 2006 10:02 pm Post subject: Re: TJPEGImage and memory size |
|
|
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
|
Posted: Thu Sep 14, 2006 8:11 am Post subject: Re: TJPEGImage and memory size |
|
|
Thanks for your help!
greetings,
Ulrich |
|
| Back to top |
|
 |
|
|
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
|
|