Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6665083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:41:06+00:00 2026-05-26T02:41:06+00:00

my api is 2.2,so i used camera.setDisplayOrientation(90) to make the preview is Portrait,this work

  • 0

my api is 2.2,so i used camera.setDisplayOrientation(90) to make the preview is Portrait,this work very well,but when i save the pic to sd,the pic is horizontal not Portrait.when i used :

@Override
    protected Bitmap doInBackground(String... params) {

        int w = bmp.getWidth();
        int h = bmp.getHeight();
        // Setting post rotate to 90
        Matrix mtx = new Matrix();
        mtx.postRotate(90);
        // Rotating Bitmap
        Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, w, h, mtx, true);
        bmp.recycle();
        return rotatedBMP;
    }

    @Override
    protected void onPostExecute(Bitmap result) {
        // TODO Auto-generated method stub
        super.onPostExecute(result);
        dialog.dismiss();

        ivNewPhoto.setImageBitmap(result);
        resultPath = ConstValue.MY_ALBUM_DIR + "/" + System.currentTimeMillis() + ".jpg";
        ImageFile.writePhotoJpg(result), resultPath);
        previewView.setVisibility(View.VISIBLE);
    }

bmp is the Snapshot pic but i have mistakes:

Activity com.android.SuperPictureSearch.photo.PhotoActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43abb200 that was originally added here

can you tell me how to save the pic is Portrait,thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:41:06+00:00Added an answer on May 26, 2026 at 2:41 am
     public void onPictureTaken(byte[] data, Camera camera) {
    
              Bitmap mutableBitmap = null;
              BitmapFactory.Options options = new BitmapFactory.Options();
              Bitmap  bm= BitmapFactory.decodeByteArray(data, 0, data.length, options);
               mutableBitmap =Bitmap.createScaledBitmap( bm , h, w,true);
                 bm.recycle();
                    Matrix matri = new Matrix();
                    matri.postRotate(90);
    
                    Bitmap  mBitmap = Bitmap.createBitmap(mutableBitmap, 0, 0, mutableBitmap.getWidth(), mutableBitmap.getHeight(), matri, true);
                    mutableBitmap.recycle();
    

    because the pic is too big form camera,so i size it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

phonegap's camera API has this iphone quirk noted: When destinationType.FILE_URI is used, photos are
I am using iPhone 2.0 SDK. I used the API UIImageWriteToSavedPhotosAlbum to save an
Ok Im building AN API but also wanting to have that API used by
In Facebook API...FBConnect...I have used API Key and App Secret...but when I login to
This is related to the Grand Central Dispatch API used in objective-c, with the
Now, this may be a silly question but sometimes the terms Framework and API
There's a word that's used in API design that relates to the coupling between
I've used the StAX API in Java quite a bit, and find it quite
Has anyone out there used TFS's API to synchronize different types of repositories? I
The Win32 API call RegisterTypeLib() is used to create the registry keys necessary to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.