It seems that bitmaps of the GDI+ Bitmap class are limited to a size of 32767 pixels in either direction (width, height).
I use Visual C++ 6.0 with latest patch, plus Platform SDK.
This limit is not documented, and I have not found anything on the topic on the net; all I did find was that GDI+ is supposed to overcome any previous short-int limitations (e.g., GDI display surface).
In the attached demo application (see CTest_bmpView::OnDraw), if 32768 or a larger value is used for the width or height of the GDI+ bitmap, although creation of the bitmap and operations on it (e.g., FillRectangle) are successful, display (using Graphics::DrawImage) or saving (Bitmap::Save) fail, with status code InvalidParameter and Win32Error, respectively.
Additional error information obtained using ::GetLastError is useless ("Operation Successful").
Has anyone encountered this problem, or even better, knows how to overcome it? Would also appreciate the odd report of reproducibility.
That's a pretty big bitmap...
i think you're right in that it might be limited to a signed short in either direction.
which limits the maximum size of a bitmap to slightly below 24 gigabytes.
now I'm not saying you'll never need that big bitmaps, i'm just saying that if you need a bitmap that big, you'll probably need to implement it yourself..
just out of curiousity, what are you using it for?
Nobody spoke of using a bitmap with size 2^15 X 2^15;
I need to display some wich may be up to a few tens of thousands of pixels high (displayed in a scrollable view), but only a few dozen pixel wide.
Used for some exotic legends in map display.
Of course there are workarounds (which I do find awkward, especially after Microsoft boasted about overcoming 16bit limitiations with GDI+)
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.