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
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.

TooolbarButton transparency. A proposal of solution

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-04-2009, 06:01 AM
Newbie
 
Join Date: Feb 2009
Posts: 3
Lightbulb TooolbarButton transparency. A proposal of solution

The proposal is to acquire at runtime from the registry the color of the toolbar and use it to replace the 0.0 pixel color of the bitmaps of an ImageList.
I hope it is useful

Sub Globals
Dim Type (R,G,B) color
Dim binary(0) As Byte

Sub App_Start
' ...
' ...
if cPPC = True Then
' acquire the color...
reg.New1
reg.RootKey(reg.rtLocalMachine)
key = "System\GWE"
binary() = reg.GetValue(key,"SysColor")
RegOrder = 15 ' position of the BtnFaceColor (used by the toolbar)...
color.R = binary((4 * RegOrder)+0)
color.G = binary((4 * RegOrder)+1)
color.B = binary((4 * RegOrder)+2)
' replace the color...
For i = 0 To ImageList1.Count - 1
bitmap1.New3 (ImageList1.Item(i))
color0_0 = bitmap1.GetPixel1 (0, 0)
For x = 0 To bitmap1.Width -1
For y = 0 To bitmap1.Height -1
If bitmap1.GetPixel1 (x, y) = Color0_0 Then
bitmap1.SetPixel(x, y, Rgb (color.R,color.G,color.B))
End If
Next
Next
ImageList1.Item(i) = bitmap1.Value
Next
End If
' now we create the toolbarbuttons...
bar.New1("FormXXXX")
btn1.New1
bar.AddToolBarButton(btn1.Value)
btn1.Style = btn1.stToggleButton
bar.AddImage2(ImageList1.Item(0))
'...
Reply With Quote
  #2 (permalink)  
Old 05-05-2009, 08:54 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

normatec nice method!
but it doesn't work with WisBar... may be in future Erel do real transparent...i'm see it in c#
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
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
ToolBarButton transparency normatec Questions (Windows Mobile) 2 05-02-2009 05:42 PM
Label transparency klaus Questions (Windows Mobile) 1 12-05-2008 05:32 PM
Help with Sprites and Transparency Drewpeu Questions (Windows Mobile) 1 09-24-2008 07:29 PM
Can I use basic4ppc to create a Bluetooth middleware solution? Olav Questions (Windows Mobile) 1 09-22-2008 12:21 PM
transparency colin9876 Questions (Windows Mobile) 7 11-16-2007 11:03 AM


All times are GMT. The time now is 05:07 AM.


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