Вот так
Bitmap bmp = new Bitmap( filePath );
Graphics g = Graphics.FromImage( bmp );
string strDate = DateTime.Now.ToLongDateString() +
" - " +
DateTime.Now.ToLongTimeString();
g.DrawString( strDate,
new Font( FontFamily.GenericSansSerif, 10 ),
new SolidBrush( Color.Black ),
new RectangleF( 1,1,320,240 )
);
g.DrawString( strDate,
new Font( FontFamily.GenericSansSerif, 10 ),
new SolidBrush( Color.White ),
new RectangleF( 0,0,320,240 )
);
MemoryStream ms2 = new MemoryStream();
//Get codecs
ImageCodecInfo[] icf = ImageCodecInfo.GetImageEncoders();
EncoderParameters encps = new EncoderParameters( 1 );
EncoderParameter encp = new EncoderParameter( Encoder.Quality, (long) nQuality );
//Set quality
encps.Param[0] = encp;
bmp.Save( ms2, icf[1], encps );
ms2.Close();
/**********Comments***************************/
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
данное сообщение получено с www.gotdotnet.ru
ссылка на оригинальное сообщение