Hello, I'm currently working on an advanced 4x4 multilayer tic tac toe(will include servers, and accounts with levels and xp). Now the problem i have is that i have a image (.png) of a piece(representing X or O) and I want the button that you click to place your X or O to have a transparent backcolor so that i can still see the image of the piece.

Thanks!

Recommended Answers

All 5 Replies

With a PNG image, open image file in your graphics program and set palette transparency i.e. the "background" color of X and O to transparent in the images palette. You should be able to do this with any graphics application. If you have also X and O images with non-transparent backgrounds just swap non-transparent image to a transparent version on mouse click event handler.

HTH

With a PNG image, open image file in your graphics program and set palette transparency i.e. the "background" color of X and O to transparent in the images palette. You should be able to do this with any graphics application. If you have also X and O images with non-transparent backgrounds just swap non-transparent image to a transparent version on mouse click event handler.

HTH

oh... I'm sorry, I forgot to say that the background of the .png is already transparent (I'm not that dumb, lol) but I cAnt get the buttons "backcolor" to be transparent.

Is your button a button control? Then you may consider some other control as a "button". You could try to use 4x4 picture boxes instead. It has all events you need and much easier graphics handling. With a button control you would have to do drawing yourself.

HTH

Is your button a button control? Then you may consider some other control as a "button". You could try to use 4x4 picture boxes instead. It has all events you need and much easier graphics handling. With a button control you would have to do drawing yourself.

HTH

I have tried but I couldn't  figure out how to get the "backcolor" transparent. If you could plz tell me how?

thanks!

ps

picturebox1.color = color.transparent

     dosnt work cuz all it dose is just matches the color of the form

oh sorry not picturebox1.color but picturebox1.backcolor

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.