Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GDI Color Depth

Reply
Thread Tools

GDI Color Depth

 
 
RobT
Guest
Posts: n/a
 
      11-06-2008
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

 
Reply With Quote
 
 
 
 
Göran Andersson
Guest
Posts: n/a
 
      11-06-2008
RobT wrote:
> 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.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
GDI+ is not properly initialized (internal GDI+ error). Robin van de Water [synthesiSFactory] ASP .Net 0 01-10-2007 08:15 AM
How you can design your site with a minimum of screen and color depth programs. Duke the Coward HTML 3 12-06-2004 04:45 PM
Loss of Color Depth (Copy / Paste from Word Image) John R. Baker Computer Support 4 11-17-2004 07:01 PM
Change color depth of [Buffered]Image Martin Java 0 09-17-2004 09:59 AM



Advertisments