A
André
Hi,
I try to create and render a graphic among other objects like e.g. tables,
labels, buttons.
The tables are not a problem, neither the graphic.
My problem is that i can't render both together. With the code below, i only
see the graphic, nothing else (no table, label, button).
How can i see the table and below the table, the graphic?
Thanks
André
My code:
Dim objBitmap As New Bitmap(400,200)
Dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
Dim redBrush As New SolidBrush(Color.Red)
Dim blueBrush As New SolidBrush(Color.Blue)
Dim greenBrush As New SolidBrush(Color.Green)
Dim whiteBrush As New SolidBrush(Color.White)
Dim blackPen As New Pen(Color.Black, 2)
Dim sngheight(10) As Single
Dim sngValue(10) As Single
Dim max, x As Integer
.....
c = New TableCell
c.Text() = "this is a tablecell"
r.Cells.Add(c) 'add to row
t.Rows.Add(r) 'add to table
frm.Controls.Add(t) 'add to form
lit = New LiteralControl("<br>")
frm.Controls.Add(lit)
objGraphic.FillRectangle(whiteBrush, 0, 0, 400, 200)
objGraphic.DrawString("A525G", New Font("Arial", 10), New
SolidBrush(Color.White), 35, 8)
objGraphic.DrawLine(blackPen, New Point(0, 195), New Point(350, 195))
objGraphic.DrawLine(blackPen, New Point(5, 5), New Point(5, 200))
....
For i = 1 To 10
sngHeight(i) = (sngValue(i) / 50+i) * 190
objGraphic.FillRectangle(redBrush, 10 + x, 194 - sngHeight(i), 20,
sngHeight(i))
Next
Response.ContentType = "image/gif"
objBitmap.Save(Response.OutputStream, Drawing.Imaging.ImageFormat.Gif)
I try to create and render a graphic among other objects like e.g. tables,
labels, buttons.
The tables are not a problem, neither the graphic.
My problem is that i can't render both together. With the code below, i only
see the graphic, nothing else (no table, label, button).
How can i see the table and below the table, the graphic?
Thanks
André
My code:
Dim objBitmap As New Bitmap(400,200)
Dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
Dim redBrush As New SolidBrush(Color.Red)
Dim blueBrush As New SolidBrush(Color.Blue)
Dim greenBrush As New SolidBrush(Color.Green)
Dim whiteBrush As New SolidBrush(Color.White)
Dim blackPen As New Pen(Color.Black, 2)
Dim sngheight(10) As Single
Dim sngValue(10) As Single
Dim max, x As Integer
.....
c = New TableCell
c.Text() = "this is a tablecell"
r.Cells.Add(c) 'add to row
t.Rows.Add(r) 'add to table
frm.Controls.Add(t) 'add to form
lit = New LiteralControl("<br>")
frm.Controls.Add(lit)
objGraphic.FillRectangle(whiteBrush, 0, 0, 400, 200)
objGraphic.DrawString("A525G", New Font("Arial", 10), New
SolidBrush(Color.White), 35, 8)
objGraphic.DrawLine(blackPen, New Point(0, 195), New Point(350, 195))
objGraphic.DrawLine(blackPen, New Point(5, 5), New Point(5, 200))
....
For i = 1 To 10
sngHeight(i) = (sngValue(i) / 50+i) * 190
objGraphic.FillRectangle(redBrush, 10 + x, 194 - sngHeight(i), 20,
sngHeight(i))
Next
Response.ContentType = "image/gif"
objBitmap.Save(Response.OutputStream, Drawing.Imaging.ImageFormat.Gif)