GDI Color Depth

R

RobT

I'll admit, that I don't do a lot of GDI+ programming and I'm sure this is
an easy answer. I'm trying to draw a couple of shapes in a web site. I can
display them just fine, but on some of the fill colors are pixelated. Is
there a way to render these colors at a better color depth?

Dim bmp As Bitmap
bmp = New Bitmap(200, 200)
Dim g As Graphics
g = Graphics.FromImage(bmp)
g.Clear(Color.White)
g.SmoothingMode = SmoothingMode.AntiAlias
Dim brsh As SolidBrush
brsh = New SolidBrush(Color.DarkGoldenrod)
g.FillPie(brsh, 10, 10, 50, 50, 0, 360)

Thanks
 
G

Göran Andersson

RobT said:
I'll admit, that I don't do a lot of GDI+ programming and I'm sure this is
an easy answer. I'm trying to draw a couple of shapes in a web site. I
can
display them just fine, but on some of the fill colors are pixelated. Is
there a way to render these colors at a better color depth?

Dim bmp As Bitmap
bmp = New Bitmap(200, 200)
Dim g As Graphics
g = Graphics.FromImage(bmp)
g.Clear(Color.White)
g.SmoothingMode = SmoothingMode.AntiAlias
Dim brsh As SolidBrush
brsh = New SolidBrush(Color.DarkGoldenrod)
g.FillPie(brsh, 10, 10, 50, 50, 0, 360)

Thanks

The Bitmap object gets the bit depth 24 by default, so the image is all
right in the code that you posted. The problem is with how you save the
image data into a file format. If you for example save it in GIF format,
that only supports a palette of 256 colors.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top