473,385 Members | 2,274 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,385 software developers and data experts.

creating bitmap wih more colors than 16?

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
Sep 18 '06 #1
0 1150

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: john | last post by:
what operation can i performe on a bitmap, in C#, that will give the visual effect of a photo negitive? I have a bitmap on a form, and when people mouse over the bitmap, i'd like all light colors...
8
by: Robert Dufour | last post by:
I been trying to look for samplecodes on how to create a simple tif file. I found a lot of commercial and stuff but I would prefer to roll my own. I only need to put some formatted text in a tif...
12
by: active | last post by:
I've been looking on the Internet for a way to convert a DIB to a Bitmap without success. Now I'm wondering if that is the approach I should be taking. All I want to do is display the DIB or...
5
by: active | last post by:
I need to know how many colors in the color table are actually used. Do I need to use Windows API? I been searching the Bitmap doc and can't find a property that would help. Is there a way...
6
by: \Frank\ | last post by:
I trying to learn what a Bitmap is. Not a Managed Bitmap Object but one that, for example, comes from the clipboard with CF_BITMAP. I'm guessing that a CompatableBitmap is an array of indices...
2
by: Piotrekk | last post by:
Hi I have a problem. I open bitmap file, load it to memory decrease color palette by proceeding Euclidean distance. As a result i have image reduced to - for example 18 colors. Once i save it -...
2
by: Peter Oliphant | last post by:
I want to create a new Bitmap which is a portion of an existing Bitmap. For example, if I have a Bitmap that is 100x100 in size I might want to create a new Bitmap that is equivalent to the one...
9
by: colin | last post by:
Hi, I have all the components of a .bmp file in memory wich i need to write to a .bmp file, (or other convenient image file) ie i have 256 color pallete of RGBquads and array of 8bit pixels, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...

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.