 |
|
ลอง Apply จากตัวอย่างนี้ครับ ใช้ VB.NET เช่นเดียวกันครับ
Code (VB.NET)
Dim intWidth,intHeight As Integer
Dim FileName As String
intWidth = 400
intHeight = 200
FileName = "MyImages/Images.png"
Dim objBitmap As Bitmap = New Bitmap(intWidth, intHeight)
Dim objGraphic As Graphics = Graphics.FromImage(objBitmap)
'*** Create Images ***'
objGraphic.FillRectangle(Brushes.Maroon, 0, 0, intWidth, intHeight)
'*** Write Text ***'
Dim strText As String = "ยินดีต้อนรับ Welcome To www.ThaiCreate.Com" '*** String ***'
Dim objFont As New Font("Tahoma", 10,FontStyle.Italic) '*** Font Style ***'
Dim objPoint As New PointF(5, intHeight - 20) '*** Point ***'
Dim objBrushWrite As New SolidBrush(Color.YellowGreen) '*** Font Color ***'
objGraphic.DrawString(strText, objFont, objBrushWrite, objPoint)
'*** Save As ***'
objBitmap.Save(Server.MapPath(FileName), ImageFormat.png)
'*** Close ***'
objGraphic.Dispose()
'*** Nothing ***'
objBitmap = Nothing
objGraphic = Nothing
.NET Write Text to Image
|
 |
 |
 |
 |
Date :
2013-05-30 09:17:51 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |