Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

Color Palette

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2010, 09:34 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default Color Palette

Agraham & Klaus

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.
Attached Images
File Type: jpg cp.jpg (23.4 KB, 35 views)
Attached Files
File Type: zip CP 1.1.zip (22.3 KB, 62 views)
__________________
David Erez
Ramat Hasharon, Israel

Last edited by derez : 08-04-2010 at 12:45 PM.
Reply With Quote
  #2 (permalink)  
Old 07-31-2010, 10:46 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Hi derez,

No problem for me, you can publish it.

Best regards and thank you.
__________________
Klaus
Switzerland
Reply With Quote
  #3 (permalink)  
Old 08-01-2010, 06:04 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Ok by me!
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #4 (permalink)  
Old 08-01-2010, 06:15 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Thank you both.
The library is at the first post.
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #5 (permalink)  
Old 08-03-2010, 08:28 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 306
Default

Hi Derez

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.

Regards
Michael
Reply With Quote
  #6 (permalink)  
Old 08-03-2010, 11:04 AM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

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
Reply With Quote
  #7 (permalink)  
Old 08-03-2010, 06:23 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

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.
Attached Files
File Type: sbp ColorBmp.sbp (2.5 KB, 15 views)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #8 (permalink)  
Old 08-03-2010, 08:56 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Thank you Agraham, I'll try to integrate it into the library.
__________________
David Erez
Ramat Hasharon, Israel

Last edited by derez : 08-03-2010 at 09:03 PM.
Reply With Quote
  #9 (permalink)  
Old 08-03-2010, 09:09 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Here's the C# equivalent to kick you off.
Attached Files
File Type: zip Class1.zip (984 Bytes, 11 views)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #10 (permalink)  
Old 08-04-2010, 07:22 AM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

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

Last edited by derez : 08-04-2010 at 07:27 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert Color to B4ppc's color? Byak@ Questions (Windows Mobile) 2 07-13-2009 12:52 PM
Color Dialog Box ceaser Basic4ppc Wishlist 12 07-29-2008 09:37 PM
Background Color im4retro Basic4ppc Wishlist 1 05-27-2008 06:11 PM
Image1.color cosmo15900 Questions (Windows Mobile) 3 02-02-2008 10:47 PM
VB color value Leginus Questions (Windows Mobile) 6 01-19-2008 11:58 AM


All times are GMT. The time now is 10:06 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0