locked
Box keeps coming out black RRS feed

  • Question

  • User-16411453 posted

     I'm totally new to this.  I just want to draw a box filled with color, and have an 1px outline in black around it.  But my box keeps coming out black. I understand the dimensioning, but I'm not sure how to paint the box with my color green. 

     

    Private Sub DrawBarGraph_Google(ByVal CompanyName As String, ByVal Count As Integer)
    
    		Dim BarValue As Integer = 0
    
    		Dim objBitmap As System.Drawing.Bitmap
    		Dim objGraphics As System.Drawing.Graphics
    		Dim oColor As System.Drawing.Color
    
    		objBitmap = New System.Drawing.Bitmap(Count, 18)
    		objGraphics = System.Drawing.Graphics.FromImage(objBitmap)
    		oColor = Drawing.Color.Green
    		Dim oBrush As New System.Drawing.SolidBrush(oColor)
    
    		Dim oBrushWrite As New System.Drawing.SolidBrush(System.Drawing.Color.Red)
    		objGraphics.DrawLine(New System.Drawing.Pen(System.Drawing.Color.Black), 0, 0, 0, 0)
    		objGraphics.DrawLine(New System.Drawing.Pen(System.Drawing.Color.Black), 0, 0, 0, 0)
    
    		'objBitmap.Save(Context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif)
    		objBitmap.Save(Context.Server.MapPath("\ice5software\BotCatcher\images\Google.com.gif"), System.Drawing.Imaging.ImageFormat.Gif)
    
    		imgGoogle.ImageUrl = "~/ice5software/BotCatcher/images/Google.com.gif"
    
    		objBitmap.Dispose()
    		objGraphics.Dispose()
    
    	End Sub
      
    Tuesday, June 3, 2008 6:13 PM

All replies

  • User-281031271 posted

    Try :

    objGraphics.Clear(Drawing.Color.Green)

    After:

    objGraphics = System.Drawing.Graphics.FromImage(objBitmap)

     

    Saturday, July 19, 2008 7:40 PM