473,672 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("imag es\\popupbackgr ound.jpg",FileM ode.Open, FileAccess.Read , FileShare.Read) ;
this.Background Image =Image.FromStre am(imgStream);
imgStream.Close ();

and when I'm executing a "Form.show( )" command, I got an OutOfMemoryExce ption 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 1246

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

Similar topics

0
3073
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 try to open third image, the JInternalFrame on top will be replaced with the new image. a) I open 2 images (thus show 2 JInternalFrame). Then when I try to open third image, the image on top is replaced and there is no java.lang.outofmemory. b) I...
2
2395
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 to load a form object ( new frmMain() ). In debug mode, the "Load" form method is executed but it crashes when it tries to set a DataTable from a DataSet in a local variable. Actually the object value in debug mode is equal to nothing.
16
7218
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
3311
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 picture box image to that variable like so: Dim img as BitMap ' (have tried BitMap and Image) img = Image.FromFile(OFD.FileName) PictureBox1.Image = img This has worked great with my photo album creator as my memory leaks
4
8003
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
1387
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 basic code. Every table in the database related to an object in the application. There is no stored procedures in database; In every object of the application, the tool generates methods for basic database operations like insert, delete, update,...
2
1706
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, textboxes, dropdownlists, about 4 panels, where every page in my wizard have almost the same controls; so all what I had to do is copy the controls from a wizard page then paste it to next one and just change the controls names and it was going all fine...
0
1221
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 cell as a result (green for equal value, red for unequal value). This colors each of the 700 columns either green or red. now, the problem: when i scroll horizontally to look at all of the columns, i will periodically run into a horrible...
3
5364
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 Transparent. This so far, works perfect. I now, would like to put another PNG image(an arrow showing positioning on the map) over the last PictureBox. The problem i'm having, the background for this second PictureBox only stays transparent when...
0
8486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8931
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8680
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4418
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.