Jump to content

Displaying a transparent PNG programatically


Recommended Posts

Posted

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?

Posted
  On 2/19/2018 at 10:52 AM, 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?

Expand  

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
Posted

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.

Posted

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.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.