Jump to content
Neil Pate

Displaying a transparent PNG programatically

Recommended Posts

I have a customer logo, a PNG with a transparent background and I wish to programatically display it on a FP which also happens to have a picture (static) pasted into the background. I have tried to use a native 2D picture control and also a .net Picturebox but cannot get the logo displaying nicely with proper transparency.

This is all a bit deja-vu for me as I struggled with a similar issue some years ago however none of those techniques seemed to do the trick now. All the forum posts seem to indicate this is quite a tricky thing to get right.

Any ideas?

Share this post


Link to post
Share on other sites
57 minutes ago, Antoine Chalons said:

just thinking out loud, have you tried to use BitMan toolkit to merge the 2 images in one and then display it?

Wow, I'm surprised anyone here remembers this rusty tool :)

Yes, it should do the job. It is available here: http://sine.ni.com/nips/cds/view/p/lang/pl/nid/209830

Check out clock.vi example

clock.png

  • Like 2

Share this post


Link to post
Share on other sites

Thanks for the suggestions; I have used BitMan in the past to do some image scaling. However in this case I am not sure it is going to help me as my background image is "static" i.e. pasted into the FP background.

Share this post


Link to post
Share on other sites

Check out Channel Operations.vi example then :)

2.png

Edited by vugie
  • Like 2

Share this post


Link to post
Share on other sites

Where have you been all my life?  Seriously though in all the various posts I've made with my "Image Manipulation" code (another thread on LAVA) which leverages .Net and the PictureBox allowing for alpha layer images, and combining layers of alpha images.  In none of these threads has BitMan ever been mentioned.  I even have used my Image Manipulation code in other projects like the Toolbar Class for things like button overlays on mouse over, but still didn't know this existed.  I think somethings probably have better performance on .Net like resizing, but still I likely wouldn't have dove into developing that code if I knew this existed.  Oh and the added benefit of being able to have controls on top, or below the image (which PictureBox can't) is awesome.

Share this post


Link to post
Share on other sites
10 minutes ago, hooovahh said:

Where have you been all my life? 

Sorry, I'm not very often here for last few years. Even less on the dark side...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.