JY
2005-04-22 19:52:45 UTC
All of my images that are 24bppRgb are also about 41MB in size,
10000x10000 pixels are fine when I make calls to FromImage, DrawImage,
etc. It's only when I try to convert the 1bpp to 24bppRbg that I run
into the problem when I make calls to DrawImage (in the process of
trying to convert pixel formats)...
I also have 1GB RAM so I don't really think that I'm literally "Out of
memory" (how did you calculate that I would need 128MB?)
Any other ideas? My code looks ok?
Thanks again for your help!!
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
That suggests to me that it's a bit large then.. If the image was
square
it'd be 6556 pixels on a side. To make a 24 bit per pixel image you'd
require 128 megabytes of memory.
There is a possibility that the resulting image is indeed too large
for the
machine.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
Format24bppRgb - I
it
10000x10000 pixels are fine when I make calls to FromImage, DrawImage,
etc. It's only when I try to convert the 1bpp to 24bppRbg that I run
into the problem when I make calls to DrawImage (in the process of
trying to convert pixel formats)...
I also have 1GB RAM so I don't really think that I'm literally "Out of
memory" (how did you calculate that I would need 128MB?)
Any other ideas? My code looks ok?
Thanks again for your help!!
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
That suggests to me that it's a bit large then.. If the image was
square
it'd be 6556 pixels on a side. To make a 24 bit per pixel image you'd
require 128 megabytes of memory.
There is a possibility that the resulting image is indeed too large
for the
machine.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
Thanks for your response Bob... The 1bpp mage is about 41MB
toHow big is the 1bpp image?
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
Hi,
I'm trying to convert an image with PixelFormat Format1bppIndexed
I'm trying to convert an image with PixelFormat Format1bppIndexed
Format24bppRgb. I keep getting the "Out of memory" message.
Here's what I've tried:(
(where bm.PixelFormat is Format1bppIndexed)
1)
bm2 = New Bitmap(bm.Width, bm.Height, PixelFormat.Format24bppRgb)
g2 As Graphics = Graphics.FromImage(bm2)
g2.DrawImage(bm, subRect, 0, 0, bm.Width, bm.Height,
GraphicsUnit.Pixel)
-> get "Out of memory"
2)
bm2 = bm.Clone(New Rectangle(0, 0, bm.Width, bm.Height),
PixelFormat.Format24bppRgb)
-> the new bitmap bm2 is Format1bppIndexed, not Format24bppRgb
Any ideas? I don't necessarily need the image to be
Here's what I've tried:(
(where bm.PixelFormat is Format1bppIndexed)
1)
bm2 = New Bitmap(bm.Width, bm.Height, PixelFormat.Format24bppRgb)
g2 As Graphics = Graphics.FromImage(bm2)
g2.DrawImage(bm, subRect, 0, 0, bm.Width, bm.Height,
GraphicsUnit.Pixel)
-> get "Out of memory"
2)
bm2 = bm.Clone(New Rectangle(0, 0, bm.Width, bm.Height),
PixelFormat.Format24bppRgb)
-> the new bitmap bm2 is Format1bppIndexed, not Format24bppRgb
Any ideas? I don't necessarily need the image to be
just need to be able to use the function "Graphics.FromImage" (so
could be Format16bppRgb555, etc). Any help will be greatly
appreciated!!
appreciated!!