I need to resize a large image of more than 2MEGABYTE and I can not upload it to the program
-
I have an image of more than 2 megabytes that can not open in any program, so I need to resize it so that any program can open if I could carry it in the program would be easy but it has an error OUT OF MEMORY someone tell me how to resize the image without loading in C Sharp
-
I have an image of more than 2 megabytes that can not open in any program, so I need to resize it so that any program can open if I could carry it in the program would be easy but it has an error OUT OF MEMORY someone tell me how to resize the image without loading in C Sharp
Hi, an OOM exception does not always really mean you ran out of memory! Look here[^]. I suggest you first validate your image file by opening it succesfully with one of the reputed image processing programs, such as Adobe Photoshop. :)
Luc Pattyn
:badger: :jig: :badger:
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
:jig: :badger: :jig:
-
I have an image of more than 2 megabytes that can not open in any program, so I need to resize it so that any program can open if I could carry it in the program would be easy but it has an error OUT OF MEMORY someone tell me how to resize the image without loading in C Sharp
I agree with Luc - I regularly work with images much bigger than 2Meg without problems in C#. I would suspect your code is at fault - try it with a small test image, and it will probably give the same error.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
I agree with Luc - I regularly work with images much bigger than 2Meg without problems in C#. I would suspect your code is at fault - try it with a small test image, and it will probably give the same error.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
The problem is not in my code is on the image that is a bmp and is a large map and i tried to open the image with Irfanview with Quantum gis and with the Gimp and the Windows can not read the image data. I want to resize the image from the file system and not from the image that appears on the screen. I have not harmed any tree to write this message but have produced a lot of smoke trying to resize the image. Thank's
-
The problem is not in my code is on the image that is a bmp and is a large map and i tried to open the image with Irfanview with Quantum gis and with the Gimp and the Windows can not read the image data. I want to resize the image from the file system and not from the image that appears on the screen. I have not harmed any tree to write this message but have produced a lot of smoke trying to resize the image. Thank's
Since nothing is opening it, it would appear that the image file is corrupted or otherwise not in an expected and supported format. Just for giggles, what are the dimensions of the image, in pixels, and the color depth?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Since nothing is opening it, it would appear that the image file is corrupted or otherwise not in an expected and supported format. Just for giggles, what are the dimensions of the image, in pixels, and the color depth?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
The problem is not in my code is on the image that is a bmp and is a large map and i tried to open the image with Irfanview with Quantum gis and with the Gimp and the Windows can not read the image data. I want to resize the image from the file system and not from the image that appears on the screen. I have not harmed any tree to write this message but have produced a lot of smoke trying to resize the image. Thank's
I think the problem may be your image then. I regularly deal with images that are in excess of 170Meg without problems, and as a simple test, I just saved one of these as a 8.5Meg .BMP file. In Paint (surely the most basic of basic rubbish image programs), it opens, edits, and saves without problems. I would try with a different image; I suspect yours is not what you think it is.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
The windows can not give me this data but I made a program that gave me height= 25163 px width = 38180 px rate of bits = 24:cool::cool::thumbsup:
That would be more than 2 gigabytes which is a different issue entirely. Adobe editor products will open a file this large in win32; but very little else will. A while back I found a free GIS viewer that would load a monster image but can't recall what it was called. If it's only a one off your least painful option might be to use a liveCD to use the linux version of GIMP to resize it; as of a year ago the win32 version puked on a file that big. I haven't tested under win64, so I don't know if that combo would work any better.
The latest nation. Procrastination.
-
Since nothing is opening it, it would appear that the image file is corrupted or otherwise not in an expected and supported format. Just for giggles, what are the dimensions of the image, in pixels, and the color depth?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
I think the problem may be your image then. I regularly deal with images that are in excess of 170Meg without problems, and as a simple test, I just saved one of these as a 8.5Meg .BMP file. In Paint (surely the most basic of basic rubbish image programs), it opens, edits, and saves without problems. I would try with a different image; I suspect yours is not what you think it is.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
The windows can not give me this data but I made a program that gave me height= 25163 px width = 38180 px rate of bits = 24:cool::cool::thumbsup:
There is no contorl that is going to load that image. You have to either find a library that will do what you want without loading the image, or write one yourself. Writing one yourself is NOT a trivial task, since you must known what the exact format of the image file is and how to work with the data. Then, you need to know about other image processing algorithms to pick out and blend individual pixels so that you can assemble the data in a smaller file, again, knowing the exact format of the image file you want write.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
The only thing I can think of is to get a handle to the file without actually loading the file into memory (OpenFile [^] may do this - if not, there may be other functions that will). Once you have that, you can read the data in the file in sections and do what you wish with them, carefully disposing of each section from memory as you go. You'll need to understand the image format so you can interpret the headers and the image data itself. I have no idea with regards to the implementation of this - just an idea that may work.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)