473,788 Members | 2,988 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show Color Palette

Hello,

I am developing an application in which the user has to select his
choice of colors and displaying the images with that color. How can I
display color palette to the user and return the selected color?

thanx in advance

Jul 4 '06 #1
1 5320
Hi,

You can create a colorpalette as the UserControl. ColorPalette is a table
structure .when you choose a color , the background color in the <tdwill
be changed.

The Code for colorpallete:

<%@ Control Language="C#" AutoEventWireup ="true"
CodeFile="Colou rPicker.ascx.cs " Inherits="Colou rPicker" %>

<style.CPCell { border:1px #FFFFFF solid; padding:2px; }

..CPCell_Over { border:1px #4B4B6F solid; background-color:#FFEEC2;
padding:2px; }

..CPImg { border:1px #999999 solid; }

..CPChosen { background-color:#FFC06F; border:1px #4B4B6F solid;
font-family:tahoma; font-size:11px; padding:2px; }

</style>

<script language="JavaS cript">

function SetColor(colImg )

{

var chosen = document.getEle mentById('Chose nColor');

chosen.style.ba ckgroundColor=c olImg.style.bac kgroundColor;

chosen.innerHTM L = colImg.alt;

}

</script>

<table cellpadding="0" cellspacing="0" border="0">

<tr>

<td id="ChosenColor " colspan="8" class="CPChosen " align="center"> No
Fill</td>

</tr>

<tr>

<td colspan="8"><im g src="images/spacer.gif" width="100" height="1"
border="0"></td>

</tr>

<tr>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Black"
style="BACKGROU ND-COLOR:#000000"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Brown"
style="BACKGROU ND-COLOR:#993300"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Olive Green"

style="BACKGROU ND-COLOR:#333300" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Dark Green"

style="BACKGROU ND-COLOR:#003300" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Dark Teal"

style="BACKGROU ND-COLOR:#003366" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Dark Blue"

style="BACKGROU ND-COLOR:#000080" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Indigo"
style="BACKGROU ND-COLOR:#333399"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Gray-80%"
style="BACKGROU ND-COLOR:#333333"

width="12" height="12" border="0"></td>

</tr>

<tr>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Dark Red"
style="BACKGROU ND-COLOR:#800000"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Orange"
style="BACKGROU ND-COLOR:#ff6600"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Dark Yellow"

style="BACKGROU ND-COLOR:#808000" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Green"
style="BACKGROU ND-COLOR:#008000"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Teal"
style="BACKGROU ND-COLOR:#008080"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Blue"
style="BACKGROU ND-COLOR:#0000ff"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Blue-Gray"

style="BACKGROU ND-COLOR:#666699" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Gray-50%"
style="BACKGROU ND-COLOR:#808080"

width="12" height="12" border="0"></td>

</tr>

<tr>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Red"
style="BACKGROU ND-COLOR:#ff0000"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Light Orange"

style="BACKGROU ND-COLOR:#ff9900" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Lime"
style="BACKGROU ND-COLOR:#99cc00"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Sea Green"

style="BACKGROU ND-COLOR:#339966" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Aqua"
style="BACKGROU ND-COLOR:#33cccc"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Light Blue"

style="BACKGROU ND-COLOR:#3366ff" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Violet"
style="BACKGROU ND-COLOR:#800080"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Gray-40%"
style="BACKGROU ND-COLOR:#969696"

width="12" height="12" border="0"></td>

</tr>

<tr>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Pink"
style="BACKGROU ND-COLOR:#ff00ff"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Gold"
style="BACKGROU ND-COLOR:#ffcc00"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Yellow"
style="BACKGROU ND-COLOR:#ffff00"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Bright Green"

style="BACKGROU ND-COLOR:#00ff00" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Turquoise"

style="BACKGROU ND-COLOR:#00ffff" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Sky Blue"
style="BACKGROU ND-COLOR:#00ccff"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Plum"
style="BACKGROU ND-COLOR:#993366"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Gray-25%"
style="BACKGROU ND-COLOR:#c0c0c0"

width="12" height="12" border="0"></td>

</tr>

<tr>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Rose"
style="BACKGROU ND-COLOR:#ff99cc"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Tan"
style="BACKGROU ND-COLOR:#ffcc99"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Light Yellow"

style="BACKGROU ND-COLOR:#ffff99" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Light Green"

style="BACKGROU ND-COLOR:#ccffcc" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Light Turquoise"

style="BACKGROU ND-COLOR:#ccffff" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Pale Blue"

style="BACKGROU ND-COLOR:#99ccff" width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="Lavander"
style="BACKGROU ND-COLOR:#cc99ff"

width="12" height="12" border="0"></td>

<td class="CPCell" onmouseover="th is.className='C PCell_Over'"
onmouseout="thi s.className='CP Cell'"><img src="images/spacer.gif"
class="CPImg" onclick="SetCol or(this);" alt="White"
style="BACKGROU ND-COLOR:#ffffff"

width="12" height="12" border="0"></td>

</tr>

</table>

Place this in our .aspx file and get it work.

Let me know if you have any doubts.

Regards,

Valli.

www.syncfusion.com


<mr************ @gmail.comwrote in message
news:11******** **************@ b68g2000cwa.goo glegroups.com.. .
Hello,

I am developing an application in which the user has to select his
choice of colors and displaying the images with that color. How can I
display color palette to the user and return the selected color?

thanx in advance

Jul 4 '06 #2

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

Similar topics

1
2180
by: Kathy | last post by:
How do I add a color palette to the font dialog? I want the font dialog to look like the standard Microsoft office Font Dialog but am unable to find any information on how to do this.
0
1518
by: James Dean | last post by:
How do i define my own Color Palette in a bitmap?........ *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
1
3258
by: eng_nahswa | last post by:
hiiiii everybody i want to know how can i create a color dialog box in asp.net application or a color palette.
1
1653
by: Merdaad | last post by:
Hi and happy new year to all I would like to have a color Pallette from which I can use colors that I can use into rows of data that I am creating. Like I want the background of one row to be red and the next one blue.... choosing the colors from a list of c olors that I can see on the side of my UI. So the color Hex code appears on the screen for each row as I select the color.
2
3031
by: jai | last post by:
c++ code to include color palette for writing a 8- bit BMP file
15
2057
by: active | last post by:
Below is a small but complete program that appears to show you can't retrive a Palette from the clipboard. This is true whether the palette is placed on the clipboard by Photoshop or Photoshop or by the below program It lets you place a palette from a file or from a program on the clipboard and allows you to retrieve one from the clipboard. But you'll find the retrieved one is always "Nothing"
8
2505
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the problem. The program uses windows api to get a handle to a palette from the clipboard. The palette needs to be put there by another program - maybe Photoshop.
2
1068
by: SuvarnaChaudhari | last post by:
any one plz tell me how to insert color palette on clicking button.I want to change color of selected text.Thanking you!
6
6408
by: Trevor2007 | last post by:
I am trying to call the color palette in access, but the only thing I keep coming accross is xldialog.paintpalette for excel but nothing for access. I would like to do this to allow the end user to customize their UI. Thanks for helping
0
9656
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
10364
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
10172
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
10110
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
9967
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
8993
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
6750
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();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
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.