By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,140 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Maximum size for a bitmap?

P: n/a
I have a vb dotnet program which uses bitmaps. The following line of
code works fine for most situations:

aBitmap = New Bitmap((100 / mZoom) * mBitmap.Width, (100 / mZoom) *
mBitmap.Height, Drawing.Imaging.PixelFormat.Format32bppArgb)

However, if the width and height values are 5376 and 46080
respectively, I get a 'invalid parameter used' error. Is there a limit
on the size of a bitmap??
Any ideas appreciated.
Claire
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
OK, so if I use this code, why do I still get the 'invalid parameter
used' error:

Const iWidth As Integer = 10000
Const iHeight As Integer = 20000
Dim aBitmap As New Drawing.Bitmap(iWidth, iHeight,
Drawing.Imaging.PixelFormat.Format32bppArgb)

Thanks for your help.
Claire
"David Williams" <Da***********@discussions.microsoft.com> wrote in message news:<DB**********************************@microso ft.com>...
(100/mZoom) * mBitmap.Width must fit into an Integer;
(100/mZoom) * mBitmap.Height must fit into an Integer.

Therefore there is a limit to the size in that both the (calculated) width and height must be > 0 and < 2,147,483,647

HTH
--
David Williams, VB.NET MVP
"Claire Greenfield" wrote:
I have a vb dotnet program which uses bitmaps. The following line of
code works fine for most situations:

aBitmap = New Bitmap((100 / mZoom) * mBitmap.Width, (100 / mZoom) *
mBitmap.Height, Drawing.Imaging.PixelFormat.Format32bppArgb)

However, if the width and height values are 5376 and 46080
respectively, I get a 'invalid parameter used' error. Is there a limit
on the size of a bitmap??
Any ideas appreciated.
Claire

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.