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();