I am developing a Zoo Database System and I have developed functionality to allow a user to write the title to an image and I can apply this to multiple images but i want to do in an efficient way.
Currently i write the title to multiple images by allowing the user to specify a directory in a textbox, creating the image objects and then outputing each image to chosen directory but I want to update the images property info where they're currently located.
So say i have 10 images in C:\SomeFolder\, if i select Save button on my form,the property information of the images that are located at in that folder should be updated.
I can save a single image to a chosen location by using a SaveFileDialog control with the following code:
private void saveJpeg(string path, Bitmap img, long quality)
{
// Encoder parameter for image quality
EncoderParameter qualityParam = new EncoderParameter(Encoder.Quality, quality);
// Jpeg image codec
ImageCodecInfo jpegCodec = this.getEncoderInfo("image/jpeg");
if(jpegCodec == null)
return;
EncoderParameters encoderParams = new EncoderParameters(1);
encoderParams.Param[0] = qualityParam;
img.Save(path, jpegCodec, encoderParams);
}
private ImageCodecInfo getEncoderInfo(string mimeType)
{
// Get image codecs for all image formats
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
//Loop through codec to get correct one
for (int i = 0; i < codecs.Length; i++)
if (codecs[i].MimeType == mimeType)
return codecs[i];
return null;
}
I would appreciate if somebody could advise please on the above.
Thanks
This post has been edited by MarmiteX1: 05 March 2010 - 12:30 PM

New Topic/Question
Reply




MultiQuote






|