473,386 Members | 1,705 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,386 software developers and data experts.

outofmemory error when setting a background picture.

Hi.

I'm trying to set the background of a form from a file with this code :

Stream imgStream= File.Open("images\\popupbackground.jpg",FileMode.O pen, FileAccess.Read, FileShare.Read);
this.BackgroundImage =Image.FromStream(imgStream);
imgStream.Close();

and when I'm executing a "Form.show()" command, I got an OutOfMemoryException and nothing is displayed in my form (all controls look like red squares with red crosses in it !). The jpg file is only 31 ko, I don't think it can fill the system memory...

Any idea ?
Nov 15 '05 #1
0 1236

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ccwork | last post by:
Hi, I get an interesting question. I program an MDI that each JInternalFrame will show an image of 1700x1500. I limit that 2 JInteralFrames (and thus 2 images) can be opened at most. When users...
2
by: Roby Eisenbraun Martins | last post by:
Hi, My name is Roby Eisenbraun Martins, I am a C++, VB and NET developer. I am working with a NET 2002 project right now and I am receiving this uncommon "OutOfMemory" error message when I try...
16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
3
by: Tim Frawley | last post by:
I am using a method that was described as the best for avoiding memory leaks when using MS Picture boxes. The main idea was to use a variable to load the image from file and then assign the...
4
by: Gary | last post by:
Hi, I get this error " " when my web page run, what does it mean? Hope someone can help!!! Gary
2
by: elaine | last post by:
I'm working on a .net web application. The architect of this web application is quite different than other web applications i worked before. Since we use a set of tools to generate most of the...
2
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi Guys, I have a real serious problem that stoped me doing any progress in my project. in one of my webpages I have a wizard of more then 13 pages and in every page some Ajax controls,...
0
by: njuneardave | last post by:
I am using a listview to hold a bunch of binary data (approx 25 rows and 700 cols). I have a compare function that compares each row's bit at a certain column. i then color the background of each...
3
by: kirk | last post by:
I have a form with a PictureBox control on it. The .Image property is set to a PNG file(which shows the picture of the US map) with some transparency in it. The .BackColor property is set to...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.