M
Mark Harris
I have the following code:
try
{
fi = new FileInfo(fn); //fn is a string from a windows form,
identifying the jpg in the file system
fullPath = fi.DirectoryName + "\\" + fi.Name;
Image bm = Image.FromFile(fullPath, true); //create an image
object from the file identifier
//bm.Tag = txtTag.Text; -- various attempts to set the
Image.Tag, inactivated for this test
//bm.Tag = (object)txtTag.Text;
bm.Save(fullPath, jpg); //this generates a "generic GDI+
error, trapped by a catch block on
//an unspecified exception -- catch(Exception ex)
}
//end code sample
//since I am in the code above merely loading the jpg and trying to save it
without any modification, I don't quite understand what has caused the
error. Any advice appreciated. I'm a neophyte at C#.
Mark Harris
St. Petersburg, FL
try
{
fi = new FileInfo(fn); //fn is a string from a windows form,
identifying the jpg in the file system
fullPath = fi.DirectoryName + "\\" + fi.Name;
Image bm = Image.FromFile(fullPath, true); //create an image
object from the file identifier
//bm.Tag = txtTag.Text; -- various attempts to set the
Image.Tag, inactivated for this test
//bm.Tag = (object)txtTag.Text;
bm.Save(fullPath, jpg); //this generates a "generic GDI+
error, trapped by a catch block on
//an unspecified exception -- catch(Exception ex)
}
//end code sample
//since I am in the code above merely loading the jpg and trying to save it
without any modification, I don't quite understand what has caused the
error. Any advice appreciated. I'm a neophyte at C#.
Mark Harris
St. Petersburg, FL