When I use the following commands I do not get a solid color loks like some
dots are in it.
Dim bmp As New Bitmap(479, 30)
Dim gfx As Graphics
gfx = Graphics.FromImage(bmp)
Dim BGroundBrush As New SolidBrush(Color.FromArgb(255, 64, 64, 64))
gfx.FillRectangle(BGroundBrush, 0, 0, 479, 30)
bmp.Save(Response.OutputStream, ImageFormat.Gif)
I want the color to match the following html
<div style = " background-color:#404040" /> 3 1614
NeedToKnow wrote:
When I use the following commands I do not get a solid color loks like some
dots are in it.
Dim bmp As New Bitmap(479, 30)
Dim gfx As Graphics
gfx = Graphics.FromImage(bmp)
Dim BGroundBrush As New SolidBrush(Color.FromArgb(255, 64, 64, 64))
gfx.FillRectangle(BGroundBrush, 0, 0, 479, 30)
bmp.Save(Response.OutputStream, ImageFormat.Gif)
I want the color to match the following html
<div style = " background-color:#404040" />
The color is correct. The dots comes from dithering done when the image
is converted to an indexed image when saving it as gif. The color is
dithered because that color is not part of the palette.
If you don't want the color to be dithered, you have to do the
conversion to an indexed image yourself, so that you can make sure that
the color is in the palette.
--
Göran Andersson
_____ http://www.guffa.com
Sorry about my ignorance, what is an indexed image and how do I convert to it?
"Göran Andersson" wrote:
NeedToKnow wrote:
When I use the following commands I do not get a solid color loks like some
dots are in it.
Dim bmp As New Bitmap(479, 30)
Dim gfx As Graphics
gfx = Graphics.FromImage(bmp)
Dim BGroundBrush As New SolidBrush(Color.FromArgb(255, 64, 64, 64))
gfx.FillRectangle(BGroundBrush, 0, 0, 479, 30)
bmp.Save(Response.OutputStream, ImageFormat.Gif)
I want the color to match the following html
<div style = " background-color:#404040" />
The color is correct. The dots comes from dithering done when the image
is converted to an indexed image when saving it as gif. The color is
dithered because that color is not part of the palette.
If you don't want the color to be dithered, you have to do the
conversion to an indexed image yourself, so that you can make sure that
the color is in the palette.
--
Göran Andersson
_____ http://www.guffa.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Steve Randall |
last post by:
I use a ColorDialog control to select a number of custom colours using the code segment below, I've fixed the index to 0 for the purpose of highlighting the problem.
Dim intRed As Integer
Dim...
|
by: jcrouse |
last post by:
I decided to start a new thread. I have output in xml file format. It looks
like this:
<P1JoyUp>
<Top>326</Top>
<Left>54</Left>
<Height>23</Height>
<Width>100</Width>
<Visible>True</Visible>...
|
by: Sam |
last post by:
Hi All
I'm having problem (which seems to be simple) to convert my color settings
using FromArgb method. The colors are saved to a text file as string, using
ToArgb.ToString method. For example...
|
by: Teemu |
last post by:
I'm wondering if there is a easy way to change for example toolstrips
appearance. I'd like to have the same theme as in VB2005. Brown backgroung
instead of the light blue. Can this be done without...
|
by: Bob Homes |
last post by:
In VB6, foreground and background colors of controls had to be assigned a
single number. If you knew the RGB values for the color, you still had to
convert them into the single number accepatable...
| |
by: sp |
last post by:
I have this strange problem. The application I am working on imports
color values from Flash that look like this:
0x-f9fff6
And, on the script side, it uses a conversion algorithm to
convert...
|
by: Yaniv |
last post by:
Hi
How can I convert Uint32 variable to System.drawing.color ??
Thanks in advanced
Yaniv
|
by: Harvey Triana |
last post by:
Hi. Say, in VB6:
Const CLR2 As Long = &HFFF0DC ' light blue
AnyObj.BackColor = CLR2
- How is the equivalent one in C#?
Thanks,
<Harvey Triana />
|
by: Larry |
last post by:
I'm sure I've missed the obvious, but when I define a custom color, my
DrawString call from my Paint event doesn't seem to draw anything at
all.
void btnNav_Paint(object sender, PaintEventArgs...
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |