Jump to content

Get current pen position in Picture Control


Recommended Posts

This question intrigued me. I use the PCT quite a bit and every function except one just passes data and then executes. The only one that returns data is Get Text Rect and it is password protected.

You can flatten the picture datatype to a string and parse it but as far as I can tell, it just mirrors the last command. This was not an exhaustive test.

It looks to me like the the PCT is actually a wrapper around a dll. The schema is very similar. If you can schmooze someone at NI to give you a full list of the Opcodes and the parameters passed, there might be a "get pen position" function.

If I learn more, I'll reply further. I'd like to hear if you make any progress.

Cheers!

Barrie

Link to comment
  • 2 weeks later...
This question intrigued me. I use the PCT quite a bit and every function except one just passes data and then executes. The only one that returns data is Get Text Rect and it is password protected.

This VI just calls into a private LabVIEW function with the Call Library Node. Not much you could learn from this other than that you can actually call into LabVIEW itself with the Call Library Node to call any of the functions documented in the External Code Manual. NI password protects these VIs because it considers those exported functions private (they are not documented in the External Code Manual) and wants to reserve the right to change or remove them in the future.

You can flatten the picture datatype to a string and parse it but as far as I can tell, it just mirrors the last command. This was not an exhaustive test.

Yes the data of a Picture Control is the stream of drawing commands. And its value therefore will be the last drawing command stream passed to it. Instead of flattening the data and parsing it you can just as well create a local variable and read the data and you will see the last stream of drawing commands passed to the control.

It looks to me like the the PCT is actually a wrapper around a dll. The schema is very similar. If you can schmooze someone at NI to give you a full list of the Opcodes and the parameters passed, there might be a "get pen position" function.

No, the Picture Control is a fully build in LabVIEW control. It was added in around LabVIEW 3 to the build in controls of LabVIEW but at that time was a separate toolkit which installed the FP control and the Picture Control Toolkit functions into the vi.lib directory. Still the control was actually part of the LabVIEW executable itself. However it was added into the standard LabVIEW distribution later on, but it is a LabVIEW control just as the numeric control or any of the graph controls with exception of the 3D control.

But I think this control doesn't even maintain a pen location at all after the drawing command stream has been evaluated. Wouldn't know for what it should maintain that as it directly translates the drawing stream commands into Winows GDI drawing commands. Try to do a Draw Line function without a Move Pen function first and you will see that the line always starts at 0,0.

Rolf Kalbermatter

Link to comment

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.