Cropped rectangle doesn’t work as expected

Discussion in 'Mac Programming' started by klern313, Aug 18, 2010.

  1. klern313 macrumors newbie

    Joined:
    Aug 18, 2010
    #1
    0 down vote favorite


    I have an NSView to draw a rectangle to crop image, and one NSImageView to be webcam (camera preview window).

    I want to put the NSView on the NSImageView.

    When I take a picture, it can produce a cropped image automatically.

    The problem is that when I don't start the camera preview window, the crop rectangle can drag and resize normally, but when I start the camera preview window, the crop rectangle out of control.

    I've implemented drag and resize function by mouse event.

    How can I resolve this problem?

    My code and program video:
    code: http://gist.github.com/536831
    video: http://www.youtube.com/watch?v=DLjuBGHh3f8

    Thanks!!
     
  2. Sydde macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #2
    What happens if you bracket the drawing calls with -lockFocus and -unlockFocus ?
     

Share This Page