473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

GDI Color Depth

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

Nov 6 '08 #1
1 1423
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
Nov 6 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: R.Wieser | last post by:
Hello All, I would like to be able to edit a .BMP-file, while retaining it's color-depth & colors. Actually, I want to cut small pieces outof one .BMP, and store it into another one. Jup,...
1
by: Hoagie | last post by:
Hello all. Is it possible to set a new depth of field (View.setBackClipDistance) when using a SimpleUniverse? I've been unable to learn a way to extract the View being used, in order to set...
3
by: scoobydoo | last post by:
hi, I have a problem displaying icons at the right colour depthin a ListView. I've made an icon file, (using IconWorkshop 5), it has 3 icons within it. A 32x32 32bpp XP style icon, a 32x32...
0
by: Jim H | last post by:
This is a cross post from windows.forms. I'm not sure where to post it. I have an application that uses transparency. My video settings are 1600x1200 and 32 bit color. I can make the main...
5
by: hayworth | last post by:
How do I get the color depth of the screen/display adapter with vb.net 2003? Background: We're having transparency problems (long side story and known Windows "bug") that requires our systems to...
2
by: Onwuka Emeka | last post by:
is there a way to reduce or modify the color depth of a jpeg image, i currently need to programatically change the color depth of a jpeg image from 24bits to 8bits. any help would be appreciated
8
by: darrel | last post by:
I've decided that instead of doing an XSLT transformation on a file, I might be better off bringing it in as a dataset and having a bit more direct control over it at that point. The question I...
13
by: softwaredoug | last post by:
I can't see to easily find this on google or in a newsgroup Is there a standard function/macro/whatever you can call and determine the distance in a C program how deep one is in the C call stack...
2
by: Gentr1 | last post by:
Hi everybody! I am presently working on a Genetic Programming API in python. I have a bit of a problem at the moment... For some specific reasons, I am using nested lists data structure to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.