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

manipulating hex in ASP.net

can asp.net handle hex values natively?

I'd like to make a tint of a color spec'd as hex. For instance, turning
ffcc33 into eebb22

Can .net do that natively, or do I need to manually translate ff = 256, cc =
144 etc, and then convert them back after doing my math?

-Darrel
Nov 19 '05 #1
2 1352
It depends what do you mean "handle hex natively"?

If you want in the compiled code have a hex numbers instead of regular numbers then yes.
Append 0x in front of it.

i = 10;
i = 0x0A; -- same thing.

Other than that there is no support actually.

If you have code like this

string s = "10"

int i = s; ----CAN NOT DO THAT.

int i = Int32.Parse(s) ---- CORRECT.

the same thing if s = 0x0A

int i = Int32.Parse(s, NumberStyles.HexNumber);

---------------------------------------------------------------------

As for the math it does not really matter how you do calculations. 10 or 0x0A is just visible representation of the number.

10*10 = 0x0A*0x0A = 100 = 0x64.
George.

"darrel" <no*****@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
can asp.net handle hex values natively?

I'd like to make a tint of a color spec'd as hex. For instance, turning
ffcc33 into eebb22

Can .net do that natively, or do I need to manually translate ff = 256, cc =
144 etc, and then convert them back after doing my math?

-Darrel
Nov 19 '05 #2
Darrell,

Take a look at the System.Drawing.ColorTranslator and
System.Drawing.ColorConverter namespaces.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"darrel" <no*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
can asp.net handle hex values natively?

I'd like to make a tint of a color spec'd as hex. For instance, turning
ffcc33 into eebb22

Can .net do that natively, or do I need to manually translate ff = 256, cc
=
144 etc, and then convert them back after doing my math?

-Darrel

Nov 19 '05 #3

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

Similar topics

4
by: Michael J. Astrauskas | last post by:
Does anyone have a function for manipulating GET variables in a URL? I want to be able to modify some parameters without affecting others. An example of what I'm looking for: Let's say the...
12
by: agent349 | last post by:
Hi, I'm fairly new to c++. I need user input in the form of dollar amounts, ie: "$10.00". I'd like to remove the dollar sign "$" then store the rest in a variable. How do I go about removing the...
10
by: Kristian Nybo | last post by:
Hi, I'm writing a simple image file exporter as part of a school project. To implement my image format of choice I need to work with big-endian bytes, where 'byte' of course means '8 bits', not...
2
by: Santa | last post by:
Hello: I am trying to manipulating the data from the pointer (the below program) in the function "test1", Is there any best way of changing the data from that pointer (I am changing by assigning...
1
by: Barb Alderton | last post by:
I am working with SharePoint 2003. I am using an existing webpart as a child control (server control). I need to access/manipulate the HTML that the control outputs prior to rendering it to the...
2
by: Don Wash | last post by:
Hi There! How do I manipulate folders in Outlook Express (Not Outlook)? I need to read messages in the mail folders as well as newsgroups. I've search on the net but all I found is how to send...
0
by: Yohancef Chin | last post by:
Does anyone know of a resource that gives the syntax commands for manipulating word through Javascript/VBscript? Thanks.
1
by: Oleg Ogurok | last post by:
Hi all, I've just realized that static data are not thread safe because they are shared by all users of the ASP.NET application. What if a static method is passed an object variable? Do I still...
1
by: Donal McWeeney | last post by:
Hi, Any pointers to manipulating client side validation being performed. For example I have a custom control that does a postback to the server - and I dont want validation to be performed...
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
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
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
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...
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
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...
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,...

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.