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

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

RGB separation

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 10-01-2007, 05:17 PM
Senior Member
 
Join Date: Apr 2007
Location: Kindred,ND
Posts: 122
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I'm using a Dell Axim X51v. I placed color rects on form with known RGB and the numbers I get i put thru you formula. I did see the ques you posted and forgot but now I will pick them using that info. Thanks for your help.
Reply With Quote
  #12 (permalink)  
Old 10-02-2007, 03:15 PM
Senior Member
 
Join Date: Apr 2007
Location: Kindred,ND
Posts: 122
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Yes I missed the - sign I am sure your right. Thanks for staying on this.
Reply With Quote
  #13 (permalink)  
Old 10-02-2007, 09:29 PM
Newbie
 
Join Date: May 2007
Location: Vancouver, CANADA
Posts: 9
Default

You can always inspect the bits of the returned color value to validate what you should be getting. In basic4ppc the returned color value is of type DECIMAL, which is 32-bits. Which is 4 bytes. I took a look at the values in the bytes and deduced that 3 of the bytes corresponded to the R, G, and B color values respectively. The fourth byte was discarded; it probably corresponds to the Alpha value used on the desktop (but not the mobile device). A function to extract the RGB color values could be written using bit operations to shift and mask the relavant bits, but you's need to use the bitwise object library. Or you could just do some math as suggested in the previous posts. Depending on how the compiler optimizes the code, the bitwise approach may be faster. Or not. At some point I'll code it up and benchmark it. However, Erel may introduce a getRGBcolor function in a future version of basic4ppc, that I'd use.
__________________
Current: Samsung Galaxy S2, Asus Transformer
Past: Dell X50v WM2003, Samsung Omnia II, Wintec 100WBT GPS
Reply With Quote
  #14 (permalink)  
Old 10-03-2007, 04:33 PM
Senior Member
 
Join Date: Apr 2007
Location: Kindred,ND
Posts: 122
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I have converted number to hex and got bytes the first =FF which means it negative the remaining 3 bytes tell me the same as specci results.
I hope the RGB sub comes out soon. I am tring to save a portion of a image on the form ie: x,y,wide,high,save/open

I will keep trying.
Reply With Quote
  #15 (permalink)  
Old 10-03-2007, 06:39 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

Quote:
Originally Posted by bdiscount View Post
I have converted number to hex and got bytes the first =FF which means it negative the remaining 3 bytes tell me the same as specci results.
That first byte is a fourth value, Alpha, that on the desktop represents transparency. The value you have is actually 255 meaning totally opaque. Zero would be totally transparent. It only appears negative because a colour value is actually four 8 bits values (0 to 255) packed into a 32 bit integer and Alpha occupies the sign bit at the top of the number.
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


All times are GMT. The time now is 12:44 AM.


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