473,388 Members | 1,256 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,388 software developers and data experts.

SolidBrush, coloring graphics gives unexpected result

I have an Access application where my forms have to different colors.
These I wish to use in my vb.net app as well.

I copy screen and paste into Photoshop and use the color picker to get
the color. It returns RGB 58,110,165.

That makes me come up with:
Dim myBrush As New SolidBrush(Color.FromArgb(100, 58, 110, 165))

I set Alpha to 100 - but don't know if this is correct. However, I
don't get the same color in the two applications. How come?
Regards /snedker
Nov 21 '05 #1
2 2100
Hi Morten,

try this:
Dim br As New SolidBrush(Color.FromArgb(58, 110, 165))

hth Peter

"Morten Snedker" <morten_spammenot_ATdbconsult.dk> wrote in message
news:t4********************************@4ax.com...
I have an Access application where my forms have to different colors.
These I wish to use in my vb.net app as well.

I copy screen and paste into Photoshop and use the color picker to get
the color. It returns RGB 58,110,165.

That makes me come up with:
Dim myBrush As New SolidBrush(Color.FromArgb(100, 58, 110, 165))

I set Alpha to 100 - but don't know if this is correct. However, I
don't get the same color in the two applications. How come?
Regards /snedker

Nov 21 '05 #2
"Morten Snedker" <morten_spammenot_ATdbconsult.dk> schrieb:
I have an Access application where my forms have to different colors.
These I wish to use in my vb.net app as well.

I copy screen and paste into Photoshop and use the color picker to get
the color. It returns RGB 58,110,165.

That makes me come up with:
Dim myBrush As New SolidBrush(Color.FromArgb(100, 58, 110, 165))

I set Alpha to 100 - but don't know if this is correct. However, I
don't get the same color in the two applications. How come?


Set Alpha to 255 or use another overload of 'FromArgb' that doesn't expect
an alpha value and will create an opaque color automatically.

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

Nov 21 '05 #3

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

Similar topics

7
by: Ruthless | last post by:
hello. I've got a simple question. I've searched on google for PHP scripts coloring syntax e.g. asm, c, c++, bash etc. I've only found some CGI, apps, modules for Apache - but i can't use...
2
by: Salim | last post by:
Hi people, keep getting this errorParse error: parse error, unexpected T_STRING in order_fns.php line 91. the code is below for the file and I've indicated line 91 <?php function...
11
by: Xah Lee | last post by:
in some online documentations, for examples: http://perldoc.perl.org/perlref.html http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-17.html http://www.haskell.org/hawiki/HaskellDemo ...
8
by: | last post by:
Wel, I am rebuilding the VC# 2002 project that I have deployment problems with the 2003 version, hoping this solves the problems, but now I encounter this wierd bug??? If I have the project, and...
2
by: Markk | last post by:
Hi. I would like to ask If somebody don't have any small sample to coloring XML syntax, e.g. in RichTextBox. It can be in VB.NET or C#. I watched on SharpDevelop, but I could not understand...
62
by: ashu | last post by:
hi look at this code include <stdio.h> int main(void) { int i,j=2; i=j++ * ++j * j++; printf("%d %d",i,j); return 0;
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
7
by: braver | last post by:
Greetings -- as a long time user of both Python and Ruby interpreters, I got used to the latter's syntax-coloring gem, wirble, which colorizes Ruby syntax on the fly. Is there anything similar for...
13
by: bintom | last post by:
I ran the following simple code in C++ and got unexpected results: float f = 139.4; cout << f; Output: 139.399994;
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
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
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
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...

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.