473,387 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

large image loading

3
Hi
I want to show a large image in C#,but I recieve Out of memory error.
how can I read the smaller block of my picture and show it.I work with GDI+.
here is my code .I try to load one part of my picture but at last line of my code I recieve this error.my image is 20MB jpg with 12000*14000

Image MapImage = null;
MapImage1 = Image.FromFile("filename.jpg");
Rectangle recDes1 = new Rectangle(0, 0, 1000, 1000);
Rectangle recSrc1 = new Rectangle(0, 0, 1000, 1000);
gr.DrawImage(MapImage1, recDes1, recSrc1, GraphicsUnit.Pixel);



by regards
Mar 28 '08 #1
3 1825
Plater
7,872 Expert 4TB
I just tried to create a bitmap of that size in mspaint and it killed it.
I think your going to need to use some Win32 APIs to only load a portion of it.
Mar 28 '08 #2
tictac
3
thanks .can you name some api that can work with image.I think I need some api to load one portion of my file to memory.can you help me please?

Regards

I just tried to create a bitmap of that size in mspaint and it killed it.
I think your going to need to use some Win32 APIs to only load a portion of it.
Mar 30 '08 #3
Plater
7,872 Expert 4TB
I can move you over to the C/C++ forums where someone there might know more about Win32 API for using large iamges.

DirectX might have something as well though.
Mar 31 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: assi | last post by:
Hello all We are developing a large dotnet application, which includes ~ 120 assemblies. (total size of all binaries is ~ 20MB). Our application also references the following dotnet assemblies:...
4
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup...
12
by: Sharon | last post by:
I’m wrote a small DLL that used the FreeImage.DLL (that can be found at http://www.codeproject.com/bitmap/graphicsuite.asp). I also wrote a small console application in C++ (unmanaged) that uses...
16
by: Claudio Grondi | last post by:
What started as a simple test if it is better to load uncompressed data directly from the harddisk or load compressed data and uncompress it (Windows XP SP 2, Pentium4 3.0 GHz system with 3 GByte...
4
by: Bruce | last post by:
I have an asp.net page that is dynamically building a table and populating cells with images (typically jpeg) and with associated metadata. How can the asp.net code efficiently determine the...
1
by: agatha.life | last post by:
I did a javascript for the loading of images (I didn't want to have the images loaded in "on loading" because they are too many). The website is for a model and if you look at the codeof pages (...
14
by: Steve K. | last post by:
I have a method that I use to get a System.Drawing.Image from a file without keeping a handle on the file open (so I can delete the file). Here is the code: <code> public static Image...
3
by: =?Utf-8?B?dGtpZWhs?= | last post by:
I have large 1bpp tiff scans of arch. drawings that are typically 12032x16890 pixels (filesize is about a 1 meg +/-) While I can readily view smaller (dimension) files, when I try to do anything...
4
by: Sophy | last post by:
Hi folks, Now, I am facing problem with canceling image loading. I have tried: var img = new Image(); img.src = "path/to/the/image"; // and then I set the img.src to another source
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.