Board index » delphi » [Q] Dealing with large bitmaps...

[Q] Dealing with large bitmaps...


2006-07-07 05:08:00 PM
delphi196
G'Day,
As I understand it the size of bitmap that can be displayed and or
managed at one time is a factor of graphics card and version of
windows. So if I have a large TCanvas that I want to save as a bitmap I
would have to save it as a sequence of "tiles" (the size being screen
resolution) where each one is a seperate bitmap. Is this correct?
Assuming the above has anyone got any sample code they are willing to
share that would allow me to take a TCanvas and save it as a sequence
of tiles on machine A. And then be able to load that same sequence on
machine B? I am worried about:
- Preserving colour depth across both machines
- Dealing with different capabilities graphics wise on each machine
All help greatly appreciated.
--
--Donovan
 
 

Re:[Q] Dealing with large bitmaps...

Donovan J. Edye writes:
Quote
G'Day,

As I understand it the size of bitmap that can be displayed and or
managed at one time is a factor of graphics card and version of
windows. So if I have a large TCanvas that I want to save as a bitmap I
would have to save it as a sequence of "tiles" (the size being screen
resolution) where each one is a seperate bitmap. Is this correct?
What do you mean by 'large'? G32 (www.graphics32.org) is capable of handling
quite large bitmaps, and adds all additional useful functionality. If this is
not enough, the commercial graphics libraries allow for even larger bitmaps for
reasonable money. Programming this functionality yourself is a considerable job.
Search the internet for 'delphi' and 'huge bitmaps'
efg's lab has a section on huge bitmaps,
www.efg2.com/Lab/Graphics/VeryLargeBitmap.htm
It is not the saving of the tiles in seperate bitmaps, but the processing of the
bitmap once loaded. Although the bmp-format might not be the most suitable. You
can save the bitmap in one file, and load it in a memorystream or something, but
only if you attach it to the TCanvas, you need to worry about the size.
Willem
Quote

Assuming the above has anyone got any sample code they are willing to
share that would allow me to take a TCanvas and save it as a sequence
of tiles on machine A. And then be able to load that same sequence on
machine B? I am worried about:

- Preserving colour depth across both machines
- Dealing with different capabilities graphics wise on each machine

All help greatly appreciated.

--
Willem van Deursen, The Netherlands
XXXX@XXXXX.COM
replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl
 

Re:[Q] Dealing with large bitmaps...

willem van Deursen writes:
Thanks for the pointers.
Quote
What do you mean by 'large'?
Images with dimensions such as:
(Draw_Width_Px : 1800; Draw_Height_Px : 2700),
(Draw_Width_Px : 2550; Draw_Height_Px : 3300),
(Draw_Width_Px : 1988; Draw_Height_Px : 3075),
(Draw_Width_Px : 2700; Draw_Height_Px : 2100),
(Draw_Width_Px : 2250; Draw_Height_Px : 2250),
(Draw_Width_Px : 1843; Draw_Height_Px : 2764),
(Draw_Width_Px : 2232; Draw_Height_Px : 2906),
(Draw_Width_Px : 2480; Draw_Height_Px : 3508)
The component I am drawing onto can provide me with its contents either
as a TCanvas, TBitmap, TGraphic descendant or as a Windows Meta File.
Now as I need to load the output on a different computer and cannot
rely on the fonts etc. to be there so a WMF is out. That only leaves me
with some form of graphics file. A TBitmap is out so I need some other
way to achieve this. As TBitmap32 (From G32) still uses a TCanvas
internally I don't see how this going to solve my problem. So to
restate my problem. How do I generate a "graphic" from a drawing area
that is the above pixel dimensions?
TIA
Quote


Donovan J. Edye writes:

>G'Day,
>
>As I understand it the size of bitmap that can be displayed and or
>managed at one time is a factor of graphics card and version of
>windows. So if I have a large TCanvas that I want to save as a
>bitmap I'd have to save it as a sequence of "tiles" (the size
>being screen resolution) where each one is a seperate bitmap. Is
>this correct?

What do you mean by 'large'? G32 (www.graphics32.org) is capable of
handling quite large bitmaps, and adds all additional useful
functionality. If this is not enough, the commercial graphics
libraries allow for even larger bitmaps for reasonable money.
Programming this functionality yourself is a considerable job.

Search the internet for 'delphi' and 'huge bitmaps'
efg's lab has a section on huge bitmaps,
www.efg2.com/Lab/Graphics/VeryLargeBitmap.htm

It is not the saving of the tiles in seperate bitmaps, but the
processing of the bitmap once loaded. Although the bmp-format might
not be the most suitable. You can save the bitmap in one file, and
load it in a memorystream or something, but only if you attach it
to the TCanvas, you need to worry about the size.


Willem
>
>Assuming the above has anyone got any sample code they are willing
>to share that would allow me to take a TCanvas and save it as a
>sequence of tiles on machine A. And then be able to load that same
>sequence on machine B? I am worried about:
>
>- Preserving colour depth across both machines
>- Dealing with different capabilities graphics wise on each machine
>
>All help greatly appreciated.
>
--
--Donovan
 

Re:[Q] Dealing with large bitmaps...

Hello Donovan,
I actually don't see your problem. I have been able to work with G32 with images
as large as 6500 * 9000 * 16 Million colors. It is not blasting fast, but it
works. Take the example of ImgView_Layers_Ex, and try to see if this loads your
image. However, your memory availability is going to be a serious issue. If the
entire image doesn't fit in RAM, your swap files are going to take a lot of time.
If you really want to create your own graphics engine, you might want to take a
look here:
www.code4sale.com/joehecht/
Is far as I understand this, Joe Hechts Excellent Image printer is exactly what
you describe, a graphic thats not relying on TCanvas. However, do try G32...
Willem
Donovan J. Edye writes:
Quote
willem van Deursen writes:

Thanks for the pointers.


>What do you mean by 'large'?

Images with dimensions such as:

(Draw_Width_Px : 1800; Draw_Height_Px : 2700),
(Draw_Width_Px : 2550; Draw_Height_Px : 3300),
(Draw_Width_Px : 1988; Draw_Height_Px : 3075),
(Draw_Width_Px : 2700; Draw_Height_Px : 2100),
(Draw_Width_Px : 2250; Draw_Height_Px : 2250),
(Draw_Width_Px : 1843; Draw_Height_Px : 2764),
(Draw_Width_Px : 2232; Draw_Height_Px : 2906),
(Draw_Width_Px : 2480; Draw_Height_Px : 3508)

The component I am drawing onto can provide me with its contents either
as a TCanvas, TBitmap, TGraphic descendant or as a Windows Meta File.
Now as I need to load the output on a different computer and cannot
rely on the fonts etc. to be there so a WMF is out. That only leaves me
with some form of graphics file. A TBitmap is out so I need some other
way to achieve this. As TBitmap32 (From G32) still uses a TCanvas
internally I don't see how this going to solve my problem. So to
restate my problem. How do I generate a "graphic" from a drawing area
that is the above pixel dimensions?

TIA


>
>Donovan J. Edye writes:
>
>
>>G'Day,
>>
>>As I understand it the size of bitmap that can be displayed and or
>>managed at one time is a factor of graphics card and version of
>>windows. So if I have a large TCanvas that I want to save as a
>>bitmap I'd have to save it as a sequence of "tiles" (the size
>>being screen resolution) where each one is a seperate bitmap. Is
>>this correct?
>
>What do you mean by 'large'? G32 (www.graphics32.org) is capable of
>handling quite large bitmaps, and adds all additional useful
>functionality. If this is not enough, the commercial graphics
>libraries allow for even larger bitmaps for reasonable money.
>Programming this functionality yourself is a considerable job.
>
>Search the internet for 'delphi' and 'huge bitmaps'
>efg's lab has a section on huge bitmaps,
>www.efg2.com/Lab/Graphics/VeryLargeBitmap.htm
>
>It is not the saving of the tiles in seperate bitmaps, but the
>processing of the bitmap once loaded. Although the bmp-format might
>not be the most suitable. You can save the bitmap in one file, and
>load it in a memorystream or something, but only if you attach it
>to the TCanvas, you need to worry about the size.
>
>
>Willem
>
>>Assuming the above has anyone got any sample code they are willing
>>to share that would allow me to take a TCanvas and save it as a
>>sequence of tiles on machine A. And then be able to load that same
>>sequence on machine B? I am worried about:
>>
>>- Preserving colour depth across both machines
>>- Dealing with different capabilities graphics wise on each machine
>>
>>All help greatly appreciated.
>>




--
Willem van Deursen, The Netherlands
XXXX@XXXXX.COM
replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl