LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write PNG file failed when build exe, but run normally on the development platform

Solved!
Go to solution

Thanks for Colin's solutions (http://www.colinzhang.net/2013/09/worklog-how-to-get-image-from-clipboard.html ). Perfectly solved the problem. 

 

Can save clipboard picture as PNG format in executable file made by LV 2017.

0 Kudos
Message 11 of 16
(897 Views)
Great to help you on this case.
Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 12 of 16
(879 Views)

To Capture just the Active Window requires two keys to be pressed. ALT + PRINT SCREEN. The example mimics both keys being pressed but only releases the ALT key , leaving the PRINT SCREEN key pressed which then 'confuses' the .NET action (for me it also left most of the keyboard inactive).

SOLUTION: before releasing the ALT key insert another call to the kbd-event function to release the PRINT SCREEN key

arg1    (0x2A - PRINT SCREEN)

arg2    0

arg3    2    (Release Key)

arg4    0

Alt-PRINT SCREEN now works for me in both environments.

 

0 Kudos
Message 13 of 16
(749 Views)

To Capture just the Active Window requires two keys to be pressed. ALT + PRINT SCREEN. The example mimics both keys being pressed but only releases the ALT key , leaving the PRINT SCREEN key pressed which then 'confuses' the .NET action (for me it also left most of the keyboard inactive).

SOLUTION: before releasing the ALT key insert another call to the kbd-event function to release the PRINT SCREEN key

arg1    (0x2A - PRINT SCREEN)

arg2    0

arg3    2    (Release Key)

arg4    0

Alt-PRINT SCREEN now works for me in both environments.

 

0 Kudos
Message 14 of 16
(749 Views)

Hi All: I'm now using LabVIEW 2023 32-bit and it looks that the bug is still present.
I tried the solutions of this thread without any successs.

For others who have the similar problem (not able to read the ciipboard image when run as exe) I have a workaround.
Use this solution using a .net 8 dll that does the job.

Andre_FR_0-1749549485942.png

I tested it with LV2023 and for me it works great, it only reads 24 bit images.

0 Kudos
Message 15 of 16
(111 Views)

@Andre_FR wrote:



For others who have the similar problem (not able to read the ciipboard image when run as exe) I have a workaround.


Or, alternatively, you can use IMAQ ClipboardToImage, but this function is only available if the Vision Development Toolkit is installed (by the way, the "opposite" IMAQ ImageToClipboard VI is also exist.)

0 Kudos
Message 16 of 16
(101 Views)