Hi
I have the following code (never mind the actually logic in this, I know it
sucks) which is very basic and a first try to create some kind of graph but
I'm stuck on the quality it seems like the gradient brush only uses 16
colors and it's not looking good at all.
How Can I make the gradient really smooth?
------------------------------------
Dim height As Integer = 10
Dim bmpImage As New Bitmap(500, 500)
Dim MyGraphics As Graphics
MyGraphics = Graphics.FromImage(bmpImage)
MyGraphics.Clear(Color.White)
Dim myBrush As LinearGradientBrush = New LinearGradientBrush(New
Rectangle(0, 0, 100, 10), Color.White, Color.Red,
LinearGradientMode.Horizontal)
For I As Integer = 0 To height Step 1
MyGraphics.FillRectangle(myBrush, New Rectangle(5 + height, (I * height) +
height, 100 + (I * 2), 5))
MyGraphics.DrawRectangle(New Pen(Color.Black), New Rectangle(5 + height, (I
* height) + height, 100 + (I * 2), 5))
Next
MyGraphics.Flush()
Response.ContentType = "image/jpeg"
bmpImage.Save(Response.OutputStream, ImageFormat.Jpeg)
------------------------------------------------------------------------------------
best regards/
Lars