1. [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Martin Stachon <martin.stachon at worldonline.cz> May 12, 2003
- 518 views
Hello, I am writing a program that will display large bitmap (base size 2330x1540) with zoom (zoom > 2x). Using win32lib. I create a pixmap, when user zooms in and zoomed bitmap does not fit into the pixmap (buffer), the pixmap is resized. When zoom is about 2, I get CreateCompatibleBitmap() errors. I am going to create several pixmaps for larger zooms, and split the bitmap between them, so I need to know the maximal pixmap size for all Win version. (I'd prefer no trial - fail practice). Is the info avaiable or is there a better solution ? (I tried not using buffer and drawing only the visible portion but this is slow for scrolling) P.S. The program will be avaiable for this community Thanks, Martin Stachon martin.stachon at tiscali.cz http://www.webpark.cz/stachon
2. Re: [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Derek Parnell <ddparnell at bigpond.com> May 15, 2003
- 439 views
Martin, I imagine the limit will be RAM and not some artificial Windows limit. A bit map of 2330 by 1540 at 2-times zoom will take about 60MB of ram (24bit color). ---------------- cheers, Derek Parnell ----- Original Message ----- From: "Martin Stachon" <martin.stachon at worldonline.cz> To: "EUforum" <EUforum at topica.com> Sent: Tuesday, May 13, 2003 12:53 AM Subject: [Win32] Maximal pixmap (CompatibleBitmap) size > > Hello, > I am writing a program that will display large bitmap (base size 2330x1540) > with zoom (zoom > 2x). Using win32lib. I create a pixmap, when user zooms in > and zoomed bitmap does not fit into the pixmap (buffer), the pixmap is resized. > When zoom is about 2, I get CreateCompatibleBitmap() errors. I am going > to create several pixmaps for larger zooms, and split the bitmap between them, > so I need to know the maximal pixmap size for all Win version. (I'd prefer no > trial - fail practice). Is the info avaiable or is there a better solution ? > (I tried not using buffer and drawing only the visible portion but this is slow > for scrolling) > > P.S. The program will be avaiable for this community > > Thanks, > Martin Stachon > > martin.stachon at tiscali.cz > http://www.webpark.cz/stachon > > > > TOPICA - Start your own email discussion group. FREE! > >
3. Re: [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Martin Stachon <martin.stachon at worldonline.cz> May 15, 2003
- 444 views
I have 256 MB RAM + 300 MB on swap avaible. I now use only pixmap of screen size and do redraw with every scroll, but I hit another problem. I use stretchBlt() to zoom the bitmap with setStretchBltMode to HALFTONE. But when the zoom is large so I source rectagle is about 100x100 pixels, HALFTONE is not used but the default stretch method (ugly). This happens only in certain areas, especially near the edges. I partially worked this around by blitting larger region the I actually need, but the problem still happens sometimes. I did not found anything on MSDN. Thanks, Martin > Martin, > I imagine the limit will be RAM and not some artificial Windows limit. > > A bit map of 2330 by 1540 at 2-times zoom will take about 60MB of ram (24bit > color). > > ---------------- > cheers, > Derek Parnell > ----- Original Message ----- > From: "Martin Stachon" <martin.stachon at worldonline.cz> > To: "EUforum" <EUforum at topica.com> > Sent: Tuesday, May 13, 2003 12:53 AM > Subject: [Win32] Maximal pixmap (CompatibleBitmap) size > > > > Hello, > > I am writing a program that will display large bitmap (base size > 2330x1540) > > with zoom (zoom > 2x). Using win32lib. I create a pixmap, when user zooms > in > > and zoomed bitmap does not fit into the pixmap (buffer), the pixmap is > resized. > > When zoom is about 2, I get CreateCompatibleBitmap() errors. I am going > > to create several pixmaps for larger zooms, and split the bitmap between > them, > > so I need to know the maximal pixmap size for all Win version. (I'd prefer > no > > trial - fail practice). Is the info avaiable or is there a better solution > ? > > (I tried not using buffer and drawing only the visible portion but this is > slow > > for scrolling) > > > > P.S. The program will be avaiable for this community > > > > Thanks, > > Martin Stachon > > > > martin.stachon at tiscali.cz > > http://www.webpark.cz/stachon > > > > > > TOPICA - Start your own email discussion group. FREE! > > > > > > > TOPICA - Start your own email discussion group. FREE! > >
4. Re: [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> May 15, 2003
- 442 views
On Thu, 15 May 2003 18:43:40 +0200, Martin Stachon <martin.stachon at worldonline.cz> wrote: >I use stretchBlt() to zoom the bitmap with setStretchBltMode to = HALFTONE. Mmmmm. I'd never heard of that, a quick web search makes me think it would be nice. Any chance of an example use or mods for win32lib? Pete
5. Re: [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Martin Stachon <martin.stachon at worldonline.cz> May 16, 2003
- 457 views
Pete Lomax <petelomax at blueyonder.co.uk> wrote: > On Thu, 15 May 2003 18:43:40 +0200, Martin Stachon > <martin.stachon at worldonline.cz> wrote: > > >I use stretchBlt() to zoom the bitmap with setStretchBltMode to HALFTONE. > > Mmmmm. I'd never heard of that, a quick web search makes me think it > would be nice. Any chance of an example use or mods for win32lib? It is in Recent User Contributions for quite some time. Martin
6. Re: [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> May 16, 2003
- 459 views
On Fri, 16 May 2003 18:06:50 +0200, Martin Stachon <martin.stachon at worldonline.cz> wrote: > >Pete Lomax <petelomax at blueyonder.co.uk> wrote: >> On Thu, 15 May 2003 18:43:40 +0200, Martin Stachon >> <martin.stachon at worldonline.cz> wrote: >>=20 >> >I use stretchBlt() to zoom the bitmap with setStretchBltMode to = HALFTONE. >>=20 >> Mmmmm. I'd never heard of that, a quick web search makes me think it >> would be nice. Any chance of an example use or mods for win32lib? > >It is in Recent User Contributions for quite some time. Erm, I've had stretchBlt for quite some time & used it lots, thanks.. it is the setStretchBltMode to HALFTONE part I cannot find. Pete
7. Re: [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Martin Stachon <martin.stachon at worldonline.cz> May 17, 2003
- 424 views
Pete Lomax wrote: > >Pete Lomax <petelomax at blueyonder.co.uk> wrote: > >> On Thu, 15 May 2003 18:43:40 +0200, Martin Stachon > >> <martin.stachon at worldonline.cz> wrote: > >> > >> >I use stretchBlt() to zoom the bitmap with setStretchBltMode to HALFTONE. > >> > >> Mmmmm. I'd never heard of that, a quick web search makes me think it > >> would be nice. Any chance of an example use or mods for win32lib? > > > >It is in Recent User Contributions for quite some time. > Erm, I've had stretchBlt for quite some time & used it lots, thanks.. > it is the setStretchBltMode to HALFTONE part I cannot find. place this in the top of stretchBlt.e : global constant xSetStretchBltMode = registerw32Function (gdi32, "SetStretchBltMode", {C_LONG, C_INT}, C_INT) global constant HALFTONE = 4 and add this just before the xStretchBlt call : -- the image will look nicer with this, but only on -- newer Windows versions if w32Func (xSetStretchBltMode, {dstDC, HALFTONE}) = 0 then warnErr( "stretchBlt : SetStretchBltMode() failed" ) end if I thought I have updated the file... Martin
8. Re: [Win32] Maximal pixmap (CompatibleBitmap) size
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> May 17, 2003
- 437 views
On Sat, 17 May 2003 11:12:47 +0200, Martin Stachon <martin.stachon at worldonline.cz> wrote: >place this in the top of stretchBlt.e : > >global constant xSetStretchBltMode =3D registerw32Function (gdi32, = "SetStretchBltMode", >{C_LONG, C_INT}, C_INT) > >global constant HALFTONE =3D 4 > >and add this just before the xStretchBlt call : > >-- the image will look nicer with this, but only on >-- newer Windows versions >if w32Func (xSetStretchBltMode, {dstDC, HALFTONE}) =3D 0 then > warnErr( "stretchBlt : SetStretchBltMode() failed" ) >end if > Thanks, that works a treat Pete