473,671 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.FromIm age(bmp)
g.Clear(Color.W hite)
g.SmoothingMode = SmoothingMode.A ntiAlias
Dim brsh As SolidBrush
brsh = New SolidBrush(Colo r.DarkGoldenrod )
g.FillPie(brsh, 10, 10, 50, 50, 0, 360)

Thanks

Nov 6 '08 #1
5 3402
"RobT" <rt*********@NO walchemSPAM.com schrieb:
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.FromIm age(bmp)
g.Clear(Color.W hite)
g.SmoothingMode = SmoothingMode.A ntiAlias
Dim brsh As SolidBrush
brsh = New SolidBrush(Colo r.DarkGoldenrod )
g.FillPie(brsh, 10, 10, 50, 50, 0, 360)
Take a look at the different constructors of the 'Bitmap' class. In
addition, take a look at the different overloads of the 'Save' method. Note
that some image formats, such as GIF, only support a certain number of
colors in the image making dithering necessary.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 6 '08 #2
Thanks for the pointers. I did modify the Save method to be jpeg instead
and that helps.

bmp.Save(Respon se.OutputStream , ImageFormat.Jpe g)

Now, is there a way to reduce the amount of compression of the jpeg so the
image is sharper? I(I have some other lines, text etc in my output). The
antialias looks fine...I'm pretty sure the compression is too high.

Thanks!

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.atwrote in message
news:eI******** ******@TK2MSFTN GP06.phx.gbl...
"RobT" <rt*********@NO walchemSPAM.com schrieb:
>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.FromIm age(bmp)
g.Clear(Color.W hite)
g.SmoothingMode = SmoothingMode.A ntiAlias
Dim brsh As SolidBrush
brsh = New SolidBrush(Colo r.DarkGoldenrod )
g.FillPie(brsh, 10, 10, 50, 50, 0, 360)

Take a look at the different constructors of the 'Bitmap' class. In
addition, take a look at the different overloads of the 'Save' method.
Note that some image formats, such as GIF, only support a certain number
of colors in the image making dithering necessary.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 6 '08 #3
"RobT" <rt*********@NO walchemSPAM.com schrieb
Now, is there a way to reduce the amount of compression of the jpeg so the
image is sharper? I(I have some other lines, text etc in my output).
The antialias looks fine...I'm pretty sure the compression is too high.
http://msdn.microsoft.com/en-us/library/bb882583.aspx
Armin

Nov 6 '08 #4
Thanks....I just discovered that myself! Works great.

"Armin Zingler" <az*******@free net.dewrote in message
news:u8******** ******@TK2MSFTN GP05.phx.gbl...
"RobT" <rt*********@NO walchemSPAM.com schrieb
>Now, is there a way to reduce the amount of compression of the jpeg so
the
image is sharper? I(I have some other lines, text etc in my output).
The antialias looks fine...I'm pretty sure the compression is too high.

http://msdn.microsoft.com/en-us/library/bb882583.aspx
Armin
Nov 6 '08 #5
RobT wrote:
Thanks for the pointers. I did modify the Save method to be jpeg
instead and that helps.

bmp.Save(Respon se.OutputStream , ImageFormat.Jpe g)

Now, is there a way to reduce the amount of compression of the jpeg
so the image is sharper? I(I have some other lines, text etc in my
output). The antialias looks fine...I'm pretty sure the compression
is too high.
Depending on your target audience, png could be a suitable file format.

Andrew
Nov 6 '08 #6

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

Similar topics

0
1617
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, sort of a tile-editor :-) Does anyone have a small sample (or pointer to one) of howto : 1) Load & save a device-independant bitmap (DIB).
1
3241
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 these values. Once I am able to set the clip distance -- is there a way to define an infinite depth? I'd like to zoom in and out of an environment without limits, and with no clipping.
3
6575
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 32bpp non-xp icon (no transparency), and a 16x16 version. I add these icons to an ImageList, which is then assigned to the LargeImageList property of the ListView.
0
1369
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 dialog transparent but other controls and child windows are not transparent, I see the colored box around my control. If I switch my color depth to 16 bit everything is fine. Why does it work on some forms but not others. I can even make my main...
5
4696
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 have the Color Depth or "Color Quality" (bits per pixel) of the display adapter (screen) to be 16 bits (Called "Medium (16 bit)" in the Display Properties Control Panel) in order for it to work.
2
4161
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
2913
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 have is if one can determine the node depth as they import the XML. I could, obviously, just put the node depth in as another xml element at the time of creation, which really isn't a big deal, but thought I'd see if I could do it on the import...
13
3828
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 from main. Something along the lines: int main() {
2
11252
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 represent a tree. The first element of a list is always the head of the node, while all others represent the tail of the node. e.g. the nested list , E], ] represent the following tree: http://www.csd.abdn.ac.uk/~mkhoury/tree.jpg I need to be able...
1
1433
by: RobT | last post by:
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)
0
8476
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7437
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.