LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PNG resize issue on front Panel (Not Programatic)

Solved!
Go to solution

I'm having an issue while trying to develop custom controls and expand my GUI beyond the default Labview options.  I'm using a flow diagram from Visio to illustrate an industrial process.  I've run into an issue when trying to add elements such as custom tanks indicators to the Front Panel.  To do so, i'm importing images from Visio, into photoshop and then saving them as .pngs to maintain transparency.  The problem i'm having is that when i drop this .png file on the front panel and resize it, Labview appears to be dropping pixels and clipping the edges of my image.  This seems to happen based on which corner i resize from. 

 

Example:

Sample PNG dropped onto a new front panel and then resized using the built in container box.  

 

Resize.jpg

 

 

I have the same issues with .gif files.  I've examined the different .png and .gif export options and i'm not seeing anything i'm missing.  I do not have an issue with jpegs so it must be something related to transparency.  Is this a known issue or is there some labview option i am missing?  I'm currenlty using Labview 2010 SP1.

 

Given that i'm still in the layout phase of my gui development, i do not know the exact dimensions of all my elements and i was hoping i would be able to resize as i go and not be completely locked in when making custom controls.  Any insight would be appreciated.  I've searched the forums but all the issues i could find were mostly programmatic resize issues.  

0 Kudos
Message 1 of 3
(2,356 Views)
Solution
Accepted by topic author Jed394

One option you could try is exporting the image as EMF or WMF. LV should be able to import that, and because it's a vector format, I believe it should also resize it correctly.

 

Another alternative is to draw it in LV itself, either using decorations or using the picture control to draw it programmatically (although you need to be aware that that option may have performance issues).


___________________
Try to take over the world!
Message 2 of 3
(2,339 Views)

tst,


Thank you, your solution worked and allowed me to bypass the photoshop step.

 

However,  the same issue occured when using a larger resolution .emf object and scaling it down.  If i use a smaller object and scale it up, i have much better results and do not see this pixel clipping.   I guess the key here is to export vector objects as the smalled resolution possible and then scale them up in labview as opposed to scalling them down.  The below screen shot is trying to illustrate the effect i saw.  You can see the scaled down object has the right side clipped while the scaled up object does not.  I don't know if this is something in the way that labview handles these object, but after some threshold it seems to start clipping pixels from the right hand side when redrawing.  Thanks for the help.

 

 

Image Test.jpg

0 Kudos
Message 3 of 3
(2,323 Views)