|
hi,
i am trying to load .gif image.As
Image img1 = Image.FromFile(path);
but it gives me OutOfMemoryException.
can any one help me for this?
Thanks
modified on Friday, March 14, 2008 4:58 AM
|
|
|
|
|
Hello,
You definitely have to show more information (code) that someone can help you!
All the best,
Martin
|
|
|
|
|
The problem might be below mentioned point:
* If image file is corrupted.
* Bitmap.FromFile method on a file stream that is not finished writing to a file.
* The image file does not have a valid image format or GDI+ does not support the pixel format of the file.
* The program does not have permissions to access the image file.
* The BackgroundImage propery is set directly from the Bitmap.FromFile method.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
1)file is'nt corrupted
2)No IO operations on File
3)Program has permissions on file
|
|
|
|
|
The image file does not have a valid image format or GDI+ does not support the pixel format of the file.
can u please explain me more about it?
|
|
|
|
|
Can catch the Error in Try Catch Block so can find the exact error message.
Please verify once again your image file might be file is not correct format.
explaon me also what you have done before loading the file
Parwej Ahamad
If you are hang on then you can send me mail g.parwez@gmail.com
|
|
|
|
|
thanks for replying
it loads while viewing from external program.I am downloading this file from Ftpserver,saving it on my System's drive and then accessing it.
I have given enough time for file to download. Unless the whole file is downloaded i dont proceed for Loading the image.
|
|
|
|
|
Can post here code ?
I think you have defined buffere size little bit maximum.
Parwej Ahamad
If you are hang on then you can send me mail g.parwez@gmail.com
|
|
|
|
|
no the buffer size is perfect for downloading
|
|
|
|
|
Dont dispose of the image (img1). This is a known issue.
|
|
|
|
|
Disposing or not disposing of the image object (img1) doesnt help.
While using
Bitmap img1 = new Bitmap(path, false);
its throwing Invalid Parameter Used Exception.
|
|
|
|
|
Image img =image.FromFile(path);
img.GetThumbnailImage(150, 150, new Image.GetThumbnailImageAbort(Nothing), IntPtr.Zero);
Nothing will be a function which will return a bool like .
private bool Nothing()
{
return true;
}
|
|
|
|
|
m am working with C#.net 1.1 desktop application.
As soon as Image img1 = Image.FromFile(iSelected); executes it throws an memoryexception
|
|
|
|
|
i m having three versions of my application...now the client want to use my second version(was using the first version)...so he wants that his database should not be lost....so i want to insert all the records from the old database to the new database(which is having some different field)...so i asked the user to enter the path of the database then check the tables name...but i didn't get how to find the fields name of tables....and then how will i insert the records from that database tables to new database tables....please someone help...both databases are in ms-access
|
|
|
|
|
We used "CREATE TABLE" and "ALTER TABLE" for modifying an old database to a new version. We checked the existence of an field in a table, e.g. "SELECT [somefield] FROM [sometable] WHERE 1 = 1", if the field does not exists, you know you has opend an old db, then create tables, alter tables, add some data and so on ...
|
|
|
|
|
Hi can anyone write a one line if() condition to find out whether a string array has undefined values??
I am checking like this:
if(arr == nullptr)
but this does not help..
Som
|
|
|
|
|
if(arr == null)
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
This checks if array itself is null. I think the OP want to know if array contains at least one item that is null.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
What about if(Array.IndexOf(arr,null)>-1) ?
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
His teacher will be impressed!
All the best,
Martin
|
|
|
|
|
foreach(string s in arr)
{
if(s==null)
{
return true;
}
}
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
assign null on the definition of your array and then you can check if(arr==null) otherwise compilor will gave error
|
|
|
|
|
Hi,
From C# I'm using an OdbcCommandBuilder to generate DELETE, INSERT and UPDATE commands for updating a MySQL table and I receive the following error:
"Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information."
I thought this was because the table had no primary key. But I checked and it does. Does anyone know another reason why I get this error?
Thanks
|
|
|
|
|
I think that this error is because you are passing a delete command for select statement. Can you please post your code for me to look into?
|
|
|
|
|
Nope, I'm pretty sure it's not that. But here's the code anyway.
OdbcDataAdapter adapter = new OdbcDataAdapter();
OdbcCommand comm = new OdbcCommand("SELECT * FROM `" + tableName + "`", connection);
adapter.SelectCommand = comm;
OdbcCommandBuilder builder = new OdbcCommandBuilder(adapter);
adapter.DeleteCommand = builder.GetDeleteCommand();
adapter.InsertCommand = builder.GetInsertCommand();
adapter.UpdateCommand = builder.GetUpdateCommand();
I suppose the insert and update commands don't work either but I get the exception when trying to generate the delete command.
|
|
|
|