Steen Schmidt Posted May 22, 2015 Report Share Posted May 22, 2015 (edited) Hi, I just attempted to use LabVIEW (2014) to make a few custom JPEGs - the customization being definition of image background color and adding some text. Then I realized that the 'Draw Text at Point.vi' and relatives really does a bad job at font anti aliasing. Comparison with a simple graphics editor (zoomed in view of a very large capital G): LabVIEW 'Draw Text at Point.vi': Paint.Net: And yes, this is very noticable even for smaller text sizes. Question: Has anybody made any good graphics creation toolkits for LabVIEW, or do I have to live with these built-in anti aliasing algorithms from 1990? Bonus question: How on earth does those image VIs font point size correlate to the font size in non-LabVIEW image editors? In Paint.Net I used font size 216, while I had to use 350pt for font size with 'Draw Text at Point.vi'. In Paint.Net the image was 96 PPI, and I reckon LV does 72 DPI only (Windows 7 was set at 96 DPI with 100% scaling). So I would've expected to set the user defined font for 'Draw Text at Point.vi' at 288pt (216 * 96/72) to get the same size letter, but I had to go up to 350pt in LabVIEW to match 216pt in Paint.Net. What gives? Cheers, Steen Edited May 22, 2015 by Steen Schmidt Quote Link to comment
mje Posted May 22, 2015 Report Share Posted May 22, 2015 Yeah, as someone who has used the picture primitives a lot, all I can say is I feel your pain with regards to quality. The bitman library is fantastic but won't help with text. As for size, LabVIEW uses the size as the pixel height of the line. So three lines of size 15 text occupy a bounding box 45 pixels high (assuming no rotation). That doesn't mean the text is 15 pixels on each line though, the exact dimensions of that are determined by the font. Quote Link to comment
JKSH Posted May 23, 2015 Report Share Posted May 23, 2015 (edited) Bonus question: How on earth does those image VIs font point size correlate to the font size in non-LabVIEW image editors? In Paint.Net I used font size 216, while I had to use 350pt for font size with 'Draw Text at Point.vi'. In Paint.Net the image was 96 PPI, and I reckon LV does 72 DPI only (Windows 7 was set at 96 DPI with 100% scaling). So I would've expected to set the user defined font for 'Draw Text at Point.vi' at 288pt (216 * 96/72) to get the same size letter, but I had to go up to 350pt in LabVIEW to match 216pt in Paint.Net. What gives? Please vote for this idea: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Font-size-standardization/idi-p/1405022 Someone made a tool to compensate for this issue (I haven't used it myself though): https://decibel.ni.com/content/groups/ui/blog/2013/06/07/font-sizes-in-labview--conversion-utility-vi Edited May 23, 2015 by JKSH Quote Link to comment
candidus Posted May 27, 2015 Report Share Posted May 27, 2015 Depending on your use case, maybe you can use the 3D picture control? Here is a snippet that renders text into a texture, applies that texture to a box object and displays it. Quote Link to comment
Steen Schmidt Posted May 28, 2015 Author Report Share Posted May 28, 2015 I have to end up with a jpg on disk, and the 3D picture control renders the text with the same old-school aliasing as the 2D pictures. The aliasing happens already in the 'Picture to Pixmap.vi'. /Steen Quote Link to comment
candidus Posted May 28, 2015 Report Share Posted May 28, 2015 You're right, the aliasing happens in the 'Picture to Pixmap.vi' but since texturing involves scaling and filtering the result looks slightly better than just using 2D with a big font size. You can then call "Render To Image" and save the result as JPEG. Quote Link to comment
candidus Posted June 1, 2015 Report Share Posted June 1, 2015 I have to admit, a blurred texture doesn't help that much. Here is a windows-only solution using .NET . The possible values of Graphics.TextRenderingHint are explained in the MSDN: https://msdn.microsoft.com/en-us/library/ssazt6bs%28v=vs.110%29.aspx. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.