אתה יכול להראות לי על הקוד הנ"ל איך אני עושה את שני הדברים האלו:
<%@ Page %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<sc_ript runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
response.charset="windows-1255"
Dim objGraphics As Graphics
Dim intHeight As Integer
Dim intWidth As Integer
Dim strLetter As String = Request.QueryString("text")
Dim objFont As New Font("BN.txt", 36, FontStyle.Bold)
' Use a dummy Bitmap to get the functionality
' needed to measure
Dim bmpDummy As New Bitmap(100, 100)
objGraphics = Graphics.FromImage(bmpDummy)
Dim objSize As SizeF = objGraphics.MeasureString(strLetter, objFont)
intHeight = objSize.Height - 10
intWidth = objSize.Width + 2
' You are now ready to create the real Bitmap
Dim bmpLetter As New Bitmap(intWidth, intHeight)
objGraphics = Graphics.FromImage(bmpLetter)
objGraphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
' You are now ready to draw the string into
' your box...
objGraphics.Clear(Color.white)
Dim objRect As New RectangleF(0, 3, intWidth, intHeight)
Dim objRect2 As New RectangleF(2, 5, intWidth, intHeight)
Dim objSF As New StringFormat()
objSF.Alignment = StringAlignment.Center
objSF.LineAlignment = StringAlignment.Center
objGraphics.DrawString(strLetter, objFont, Brushes.Gray, objRect2, objSF)
objGraphics.DrawString(strLetter, objFont, Brushes.navy, objRect, objSF)
' You send the Bitmap to the browser
Response.ContentType = "image/gif"
bmpLetter.Save(Response.OutputStream, ImageFormat.Gif)
' You clean up
bmpLetter.Dispose()
bmpDummy.Dispose()
objGraphics.Dispose()
objFont.Dispose()
objSF.Dispose()
End Sub
</sc_ript>