7 Replies - 1005 Views - Last Post: 12 February 2013 - 02:53 AM Rate Topic: -----

#1 Lukee9  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 15-August 12

See labels through transparent area of a picturebox

Posted 26 January 2013 - 10:38 AM

Hey.

What I need help with:
I am trying to create a program where the background is my logo, my logo is a tree, the left half of the tree is solid, and the right half of the tree is made of 1s and 0s (still making the shape of the tree)
I want my program to make the 1s and 0s part of the tree change randomly (the 1s and 0s) so its an animated logo, the only trouble I faced is that I can't make the 1s and 0s fit the shape of the tree, I am trying to make them fit the shape of the tree by just going onto photoshop, selecting the shape of the tree and then filling in the inverse of that (so that the tree shape is transparent and that everything else is filled in with black); I would then have the 1s and 0s behind that, and only the 1s and 0s of the label inside the transparent area would be seen, however it seems you can't see labels, or other pictureboxes for that matter, through the transparent area of a picturebox. I have changed backcolor to transparent and it doesn't work, all that happens is the transparent area is filled with the background colour/image of the form.

Summary: So, the summary is that I want a way to see the contents of a label through the transparent area of an image, the image should be in front and the label should be in hide (Z axis), I heard with pictureboxes you use GDI+ but you can't do this with labels, and I want the labels to be constantly changing. I don't want the transparent area to just show the background image/colour I want it to show what is behind it as well (the label in this case)
Thanks
~Lukee9

P.S: You can ask for additional information below, however I won't upload the logo to be seen :)

Is This A Good Question/Topic? 0
  • +

Replies To: See labels through transparent area of a picturebox

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,175
  • Joined: 02-July 08

Re: See labels through transparent area of a picturebox

Posted 26 January 2013 - 10:55 AM

If you learn how to use GDI+ you can paint all the items you want and the transparent parts will remain. The order in which you paint will be like layers. Draw text with .DrawString instead of a label.

This post has been edited by _HAWK_: 26 January 2013 - 10:56 AM

Was This Post Helpful? 1
  • +
  • -

#3 Lukee9  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 15-August 12

Re: See labels through transparent area of a picturebox

Posted 26 January 2013 - 11:34 AM

View Post_HAWK_, on 26 January 2013 - 10:55 AM, said:

If you learn how to use GDI+ you can paint all the items you want and the transparent parts will remain. The order in which you paint will be like layers. Draw text with .DrawString instead of a label.

Thanks :), you reply to all my topics :D, I will do the GDI but I didn't really want to as it seems complicated :), thanks though :D
~Lukee9
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,175
  • Joined: 02-July 08

Re: See labels through transparent area of a picturebox

Posted 26 January 2013 - 12:00 PM

I get that it has a learning curve, but it will serve you well. Come back for any specific problems. Do check out BobPowell.Net - that's where I learned from.
Was This Post Helpful? 1
  • +
  • -

#5 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,500
  • Joined: 29-May 08

Re: See labels through transparent area of a picturebox

Posted 26 January 2013 - 12:16 PM

Or switch to WPF with it XAML based controls that support transparency.
Was This Post Helpful? 0
  • +
  • -

#6 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: See labels through transparent area of a picturebox

Posted 26 January 2013 - 01:46 PM

If the BackColor of the Form is alright under the 1s and 0s, then I would ask if you have tried placing the Label on TOP of the PictureBox, and making the Label.BackColor the same as the Form.BackColor.

This post has been edited by lar3ry: 26 January 2013 - 03:40 PM

Was This Post Helpful? 0
  • +
  • -

#7 Lukee9  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 15-August 12

Re: See labels through transparent area of a picturebox

Posted 01 February 2013 - 01:42 PM

Hey, I'd just like to say to anyone else who is having this problem (and I know a lot of people do), you can use panels instead of pictureboxes to see through the transparent areas, however this is a simple and sometimes insufficient method so I do suggest learning GDI+
Thanks
~Lukee9
Was This Post Helpful? 0
  • +
  • -

#8 deery5000  Icon User is offline

  • D.I.C Addict

Reputation: 76
  • View blog
  • Posts: 985
  • Joined: 09-May 09

Re: See labels through transparent area of a picturebox

Posted 12 February 2013 - 02:53 AM

Overlay images also
http://www.vb-helper...ransparent.html
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1