تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
توليد أيقونة من نص
#1
كاتب الموضوع : Boutemine Oualid

السلام عليكم و رحمة الله و بركاته

فيبي .نت

كود :
Function CreateIcon(string s) As Icon
Dim bmp As New Bitmap(16, 16)
Dim brush As New SolidBrush(Color.Black)
Dim g As Graphics = Graphics.FromImage(bmp)
g.DrawString(s, New Font("Arial", 10f), brush, 0, 0)
g.Dispose()

Dim hIcon As IntPtr = bmp.GetHicon()
Return Icon.FromHandle(hIcon)
End Function
سي شارب

كود :
public static Icon CreateIcon(string s)
{
Bitmap bmp = new Bitmap(16, 16);
SolidBrush brush = new SolidBrush(Color.Black);
Graphics g = Graphics.FromImage(bmp);
g.DrawString(s, new Font("Arial", 10f), brush, 0, 0);
g.Dispose();
IntPtr hIcon = bmp.GetHicon();
return Icon.FromHandle(hIcon);
}
}}}
تم الشكر بواسطة:


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم