Asp.Net Image Generator

string sorgu = “select adsoyad from kullanicilar  where adsoyad is not null “;
SqlCommand emir = new SqlCommand(sorgu, cnn);
cnn.Open();
SqlDataReader okuyucu = emir.ExecuteReader();
while (okuyucu.Read())
{

//start processing…
string _resimyolu = “”, yol = “”;
Bitmap b = new Bitmap(1, 1);
Font f = new Font(“Arial”, 24);
Graphics graphics = Graphics.FromImage(b);
yol = okuyucu[“adsoyad”].ToString();
int width = (int)graphics.MeasureString(yol, f).Width;
int height = (int)graphics.MeasureString(yol, f).Height;
b = new Bitmap(b, new Size(width, height));
graphics = Graphics.FromImage(b);
graphics.Clear(Color.DarkBlue);
graphics.DrawString(yol, f, new SolidBrush(Color.White), 0, 0);
graphics.Flush();
_resimyolu = “d:\\deneme\\” + okuyucu[“adsoyad”] + “.png”;
b.Save(_resimyolu, System.Drawing.Imaging.ImageFormat.Png);

}
okuyucu.Close();
cnn.Close();

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

ten − four =

This site uses Akismet to reduce spam. Learn how your comment data is processed.