title: when using android NDK NativeWindow to display image, how to lock orientation?
body: <p>In android NDK, when use NativeWindow to display image, how to lock the orientation? Basically, when the phone rotate, I want the image relatively still to the phone. (See the illustration below, in case I’m not clear).</p>
  
  <pre><code>_____
  |  ^ |                
  |  o |  
  |____|   
  
  _______ 
  | &lt;  o |
  |______|                
  </code></pre>
  
  <p>I followed the sample program native plasma, and used the ANativeWindow_Buffer. My image resolution is 480x800, the native window’s resolution is also 480x800 if I hold the phone in portrait mode. However if I hold the phone in landscape mode, the native window size becomes 800x480, and my displayed image mess up unless I change how I fill the buffer. I wonder if there is a way to set the native window buffer size always to 480x800, and prevent it change when the phone rotates.</p>
  
  <p>I see in the ANativeWindow API, there is a function, ANativeWindow_setBuffersGeometry
  I tried to use it to set the buffer geometry to 480 by 800, but it did not have any effect.</p>
  
  <p>Please help. 
  Thanks.</p>