Sunday, March 2, 2014

 After the android mobile phone camera, the algorithm logic problems crop the image function?


Want to achieve, or select a picture from a photo album, preview and crop function.
Cropping frame size may be true phone screen width and height, but can not be displayed on the display screen when the edge, so did a 80% zoom. That is 80% of the true size of the user settings will be displayed. For example, the user's screen is 480 * 800. So 384 * 640 box displays on the screen size.
Meanwhile loaded picture may be very large, by BitmapFactory.Options the inJustDecodeBounds method to obtain a picture of a similar size and loading screen display to prevent oom, after loading the picture may be amplified by the matrix, out, pan. Then press the location and size of the user's operation of the interception of the box, the real picture on the interception of 480 * 800 small images to be saved.
Now, how the picture on the screen relative to the upper left corner of the frame 384 * 640 x, ​​y and lower right x, y is loaded into the real image of 480 * 800 intercept value of the upper left corner and lower right.

Intent can not be used to call the system's crop will be cut. That does not meet the requirements.<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->

No comments:

Post a Comment