I combined Agraham's ColorDialog and Klaus's ColorPalette module to one library.
I request your permission to publish it.
Thanks.
Edit:
The zip file contains dll & cs files, simple demo program which can be used to see the use of the few methods, and the palette.
The palette should be placed with the application or in directory "images" underneath.
Preset colors can be changed one at a time.
The lib is for use of Desktop and Device, tested for QVGA and VGA.
Edit: - ver 1.1, the palette is embeded in the code, and also I found that a desktop version is required for compilation.
__________________
David Erez
Ramat Hasharon, Israel
Thanks for the combined library. Just one question. Is it please possible to put the color palette in an imagelist so that it gets compliled with the program.
Do believe me I wanted to do it when tackled with the folder and file icon images in TvDialog. I wanted the library to load the images from the Library directory to a imagelist and then use it.
I asked Erel how to do it and this is what he answered:
Quote:
It is not possible to embed this files in the compiled executable without a user action (adding them to an Imagelist). These files are only added when you target smartphones and it is not configured.
If you like you can embed them in your DLL, however you will need to distribute the dll instead of compiling the code.
If someone will show me how - I'll be glad to do it.
__________________
David Erez
Ramat Hasharon, Israel
You could always generate the bitmap yourself in the library if you really want to get rid of the file. An unoptimised algorithm is in the attached project. It's a bit slow in the IDE but runs in a flash when compiled.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Thank you Agraham but I used the existing private method in the library, and the bitmap creation is reduced to this piece of code :
Code:
this.palette = new Bitmap(120,120) ;// create the palette bitmap for (int h = 0;h <120;h++) for(int s = 0;s <120;s++) this.palette.SetPixel(h,s,HSLToRGB(h*2,240-s*2,120));
The library is updated to ver 1.1
__________________
David Erez
Ramat Hasharon, Israel