Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem with setting the orientation of the image
    primarykey
    data
    text
    <p>Is my second question on this topic today but on the previous one it seems I haven't been clear enough.</p> <p>I have an activity where I'm building my own camera in order to take pictures. In the <code>onCreate()</code> method of this activity I'm doing something like:</p> <pre><code>this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); </code></pre> <p>otherwise my whole screen looks like this: .Anyway this solves my issues for the moment and the image is looking good.</p> <p>After taking the picture I'm using a bundle and send the image to another activity(Activity B) where I edit the picture and after that save the image to a website.</p> <p>And here is the problem: The picture received in this activity is again orientated wrong like here: ![enter image description here][1] because I haven't done any operations upon the image itself, only on the activity orientation.</p> <p>Now, I could do in here barely the same thing and set the activity in the <code>LANDSCAPE</code> mode and my activity would be looking good again, but further more when I upload the image to a website this would look wrong on the website for the simple fact that I haven't done anything to set her own orietntation.</p> <p>So, in my <code>surfaceChanged()</code> - in the <code>activity A</code> , the first one, method I've done something like this:</p> <pre><code>Camera.Parameters p = mCamera.getParameters(); p.set("orientation", "landscape"); p.setRotation(90); mCamera.setParameters(p); </code></pre> <p>But this has no effect on the image, it looks the same.</p> <p>I'm working on <code>Sony Ericsson</code> and need help on rotating my image-not setting up the <code>orientation of my activity</code>!</p> <p>Thank you, I'm here for further details.Thanks</p> <p>EDIT: In <code>activity A</code> where I'm taking the image I'm doing this:</p> <pre><code>Camera.PictureCallback mPictureCallback = new Camera.PictureCallback(){ public void onPictureTaken(byte[] imageData, Camera c) { if (imageData != null) { Intent mIntent = new Intent(); //StoreByteImage(mContext, imageData, 50, "ImageName"); mCamera.startPreview(); Bundle b = new Bundle(); b.putByteArray("imageData", imageData); Intent i = new Intent(mContext,ImageDisplayActivity.class); i.putExtras(b); startActivity(i); setResult(FOTO_MODE, mIntent); finish(); } } }; </code></pre> <p>And in <code>activity B</code> where I'm receiving the image I'm doing this:</p> <pre><code>Bundle extras = getIntent().getExtras(); BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 5; byte[] imageData = extras.getByteArray("imageData"); Bitmap myImage = BitmapFactory.decodeByteArray(imageData , 0, imageData.length,options); ....///is set up the bitmap to an imageview </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload