Jump to content

Control picture zoom


Recommended Posts

Hi guys,

I am trying  to make a picture controler on my interface. I can drag and zoom my picture but my zoom is too bad ....

My picture is big and I didn't find the way to make a zoom on the center of my indicator image with the zoomfactor. All my calculate tries failed and my reseachs on the web failed ...

I am not really sure if i am clear but I can answer your questions.

Best,

Flavien

 

Control_Picture.vi

Link to post

This is an imperfect solution from a project of mine. A scroll of the mouse wheel zooms in or out by a factor sqrt(sqrt(2)), centering the zoom on the pixel upon which the cursor lies. The arithmetics of that is easy, it just involves that {ox,oy}->{px,py}-{px-ox,py-oy}*z1/z2, where {ox,oy} is the origin and {px, py} are the image coordinates of the pixel pointed at. That is, the new origin is just moved proportionally along the line connecting the old origin and the current pixel, all in image coordinates.

Differently than you, I haven't implemented limits on the zoom factor based on the image size and position, perhaps one should.

 

z.png

Edited by ensegre
Link to post

As an aside: I realize that the computation of the current pixel coordinates could be avoided using, like you did,

p.png

however it seems that these coordinates are not always polled at the right time; for instance I get {-1,-1} during mouse scroll. That might be part of the problem...

Edited by ensegre
Link to post

Join the conversation

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

Guest
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.

  • Similar Content

    • By Gael Anquetil
      Hello,
      I am trying to use classical touchscreen moves on my LabVIEW application. The problem is I really don't know how read the information coming from Windows indicating the type of move (zoom rotate, span,...)!
      I tried to use the Windows message queue library (using user32.dll) with the message WM_TOUCH and WM_GESTURE but nothing works. I don't know if it's compatible...
      Does anyone tried to do this? 
      Thanks for your help!
    • By Voklaif
      Hello all,
      I am looking for a way to find controls on an executable LV program. 
      I need this function because I want to automate a series of tests (user mouse clicks for example) on an executable LV program.
      The normal tools who does it with windows objects are not able to recognize LV controls individually.
      My idea is to find a way to recognize LV controls so I can interact with them individually.
      If anyone knows any third party programs to do automation tests for a LV exe that would also be highly appreciated.
       
      Best Regards,
      Vlad
    • By MartinRJ
      Hello,

      I'll explain the application that I have to make.

      I have a laser sensor (Scan Control) which rotates with an electric motor, it will measure a hole. For that, he turns and must to collect data for each grade of rotation. 180 / half turn -> 180 points / half turn. I have already a Labview program that translates the data sensor in mm.

      Now I have to make a program to to synchronize the data acquisition.

      I thought about two solutions:
      -Drive will sent the triggeur (I do not know if it can be done)
      -Analog encoder with a rising edge of the sine or cosine signal.
      The encoder has 32,000 points per revolution (resolution) so it should acquire at each 32000/180 = 180 periods of the encoder signal.


      How can I do this on Labview?

      I hope I have expressed well,

      Thank you in advance to all.
    • By Benoit
      This XControl has the nice feature that a Calendar control should give you.
      Multilanguage support by property node.
      The input and output are Labview Time Stamp.
       
      When selecting a date, the date in the calendar become light blue.
       
       
      Please you receive this XControl for free. The minimum you can do is to rate it.
       
    • By Benoit
      Name: Calendar XControl
      Submitter: Benoit
      Submitted: 09 Jan 2016
      Category: *Uncertified*
      LabVIEW Version: 2011License Type: BSD (Most common)



      This XControl has the nice feature that a Calendar control should give you.
      Multilanguage support by property node.
      The input and output are Labview Time Stamp.
       
      When selecting a date, the date in the calendar become light blue.
       
       
      Please you receive this XControl for free. The minimum you can do is to rate it.
       

      Click here to download this file
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.