dotnet transparency

I have small question.
I want to create transparent dotnet elements like buttons(text inside button should be visible and background color should be transparent), labels etc on the background of bitmap and I noticed in spite of button color is transparent, when I put bitmap underneath button, the bitmap is covered by button and it seams like button background is not transparent.Why?
I use testButton.BackColor = bgcolor; or testButton.ForeColor.Transparent or
testButton.BackColor = Transparent but still I have no transparency. How to achieve such a simple button transparency?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kredka's picture

Ok so I did a litle homework

I spent night yesterday to figure this out, so I have dotnet bitmap displayed in rollout and dotnet transparent(kind of) button, in this same place and still no progress. Button background textfield look white a cover bitmap. I attached my simple code but it seams super difficult to achieve such a simple effect. What do I have to do more to complete it? I need the simplest possible way to do it as I'm not skilled in programming but I went so far so I don't want to give up on this.

AttachmentSize
test.zip 783 bytes
kredka's picture

I wish it could be so

I wish it could be so simple:)
I tried this on buttons and labels and the only thing change is gackground color on white. Still no transparency. I declarate bitmap in standard max way.

Bellow simple code

Rollout arollout "Static Test"
(
dotNetControl tb "Label" width:180 height:24
bitmap bmp13 "Bitmap" pos:[2,4] width:675 height:396 fileName:"NPC_BACKGROUND1.bmp"
--or
bitmap BitmapImage bitmap:(bitmap 350 350 color:blue)

on arollout open do
(
tb.Text = "This is A String"
tb.BackColor = tb.BackColor.Transparent
-- or
--tb.BackColor = (dotNetClass "System.Drawing.Color").transparent
tb.Font = DotNetFont "Times" 16 #bold
)

)
createDialog arollout width:250 height:250

barigazy's picture

...

You are tried imposible solution and this is not "small" question.
U need to use .net panel as dotNetControl and label as dotNetObject on rollout open event where you need to define all props for label and panel of course. Also U can't use mxs bitmap but .net Bitmap or .net image (*.png) or Paint Event to draw text or graphic to a bitmap.
There is too many way in .net how to create or load image for most controls(labels, buttons etc.). Use this forum and CGtalk to explore a bit this topic and then we can continue here. Good luck ;)

bga

barigazy's picture

...

Next time you need to participate or ...

AttachmentSize
logobtn.ms 47.12 KB

bga

barigazy's picture

...

Move mouse cursor on/off the button to see difference

AttachmentSize
logobtn_v2.ms 47.47 KB

bga

barigazy's picture

...

testButton.BackColor = testButton.BackColor.Transparent
-- or
testButton.BackColor = (dotNetClass "System.Drawing.Color").transparent

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.