<Script Runat="Server">
sub Page_load 
   dim objbitmap as  Bitmap
   dim objGraphics as Graphics
   dim objBrush as SolidBrush
   dim objfont as New Font("Arial",16)
   objBitmap = new Bitmap(400,200)
   dim objformat as new stringformat()
   objGraphics=Graphics.fromImage(objBitMap)
   dim objrec as  rectanglef=new rectanglef(10,10,300,200)
   objbrush=new solidBrush(color.Fromargb(80,132,234))
   objgraphics.drawstring("234234234234234",objfont,Brushes.blue,objrec,objformat)
  Response.ContentType="image/jpeg"    OBJgraphics.dispose() 
   objbitmap.dispose()
'   objbitmap.save(response.outputstream,imageformat.gif)
end sub 
输除了还是不行

解决方案 »

  1.   

    参考:http://www.dotnetjunkies.com/printtutorial.aspx?tutorialid=552
      

  2.   

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load    Dim objBmp As New Bitmap(325, 200, PixelFormat.Format24bppRgb)
        Dim objGraphics As Graphics = Graphics.FromImage(objBmp)
        objGraphics.SmoothingMode = SmoothingMode.HighSpeed    'Fill the box
        objGraphics.Clear(Color.Chartreuse)    'Draw the oval
        objGraphics.DrawArc(New Pen(Color.Yellow, 3), 20, 75, 125, 70, 0, 360)    'Draw the text
        objGraphics.DrawString("ASP.NET", New Font("Times New Roman", 48, FontStyle.Bold), SystemBrushes.WindowText, New PointF(10, 80))    'The physical path to save to
        Dim sPath As String = Request.PhysicalApplicationPath    'The new filename
        Dim sFileName = GetTempName("jpg")    'Save and bind it
        objBmp.Save(sPath & "graphics\" & sFileName, ImageFormat.Jpeg)
        Image1.ImageUrl = "graphics\" & sFileName    objGraphics.Dispose()
        objBmp.Dispose()
    End Sub