imageview issue

+2 Wait Badu · November 16, 2014
Hi, 
i have a imageview that sometimes after a user choose the image sometimes its rotates the picture  to the left so its on its side. I'm wondering if their any forums or link to something that would let the user adjust the image to their satisfaction.

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
0 Developer John · November 16, 2014
Why not just adjust the image using paint? If you can't, then I would go here: http://www.picresize.com/
0 Wait Badu · November 18, 2014
i cant adjust the image because i want it to possible for the user to choose themselves so i cant adjust their image before they choose it.  Sorry if you don't get what I'm saying I'm new to programming i don't really have the lingo down yet .
0 Developer John · November 18, 2014
What language?
0 Wait Badu · November 19, 2014
java 
0 Developer John · November 19, 2014
May I see your code please?:sideways:
0 Wait Badu · November 20, 2014
oh sorry about that 



iv = (ImageView) findViewById(R.id.imageView);

iv.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
 // TODO Auto-generated method stub
 Intent profilepic = new Intent(
  Intent.ACTION_PICK);
 profilepic.setType("image/*");
  startActivityForResult(profilepic, SELECT_PHOTO);

}

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { 
        super.onActivityResult(requestCode, resultCode, imageReturnedIntent); 

        switch(requestCode) { 
        case SELECT_PHOTO:
            if(resultCode == RESULT_OK){
 try {
 final Uri imageUri = imageReturnedIntent.getData();
 final InputStream imageStream = getContentResolver().openInputStream(imageUri);
 final Bitmap selectedImage = BitmapFactory.decodeStream(imageStream);
 iv.setImageBitmap(selectedImage);
 } catch (FileNotFoundException e) {
 e.printStackTrace();
 }
-1 Developer John · November 20, 2014
Andriod Development? 
0 Troy Jones · November 20, 2014
where's your onCreate method?
0 Wait Badu · November 20, 2014
yeah android development  ... my onCreate method

public class MainPage extends Activity implements OnClickListener
{

TabHost th;
TextView Catergories, Uotw, Aotw, Ds, Hmos, Eds, Cl;
Button go, Submit;
EditText Name, Email, Phone, Info;

File path;
ImageView iv;
VideoView Vv;
Intent intent = getIntent();
final static int cameraData = 0;
protected static final int SELECT_PHOTO = 1;


@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main_page);
th = (TabHost) findViewById(R.id.tabhost);

Name = (EditText) findViewById(R.id.etNameOfBusiness);
Email = (EditText) findViewById(R.id.etEmail);
Phone = (EditText) findViewById(R.id.etPhone);
Info = (EditText) findViewById(R.id.etAdditionalInfo);

Name.setText("Name");
Email.setText("Email");
Phone.setText("Phone");
Info.setText("Info");

Catergories=(TextView) this.findViewById(R.id.tvCatergorieslv);
Uotw = (TextView) this.findViewById(R.id.tvUserOfTheWeek);

Aotw = (TextView) this.findViewById(R.id.tvArtistOfTheWeek);

Ds = (TextView) this.findViewById(R.id.tvDealSection);
Hmos = (TextView) this.findViewById(R.id.tvHearMeOutSection);
Eds = (TextView) this.findViewById(R.id.tvEncounteredDeals);
Cl = (TextView) this.findViewById(R.id.tvCommentLounge);

iv = (ImageView) findViewById(R.id.imageView);




iv.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
 // TODO Auto-generated method stub
 Intent profilepic = new Intent(
  Intent.ACTION_PICK);
 profilepic.setType("image/*");
  startActivityForResult(profilepic, SELECT_PHOTO);

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { 
        super.onActivityResult(requestCode, resultCode, imageReturnedIntent); 

        switch(requestCode) { 
        case SELECT_PHOTO:
            if(resultCode == RESULT_OK){
 try {
 final Uri imageUri = imageReturnedIntent.getData();
 final InputStream imageStream = getContentResolver().openInputStream(imageUri);
 final Bitmap selectedImage = BitmapFactory.decodeStream(imageStream);
 iv.setImageBitmap(selectedImage);
 } catch (FileNotFoundException e) {
 e.printStackTrace();
 }

            
        }}}

theres more to code in my activity but i didnt add it cause it didnt think its relevant to my question 
-1 Developer John · November 20, 2014
Oh, ok, sorry, I can't help you with that.
  • 1
  • 2

Java / Android Development

107,276 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator