Re: [android-developers] Fitting image to a screen

2012-05-08 Thread Mohamed ElSanousi
Its okay. I did the research but I didn't find what I'm looking for exactly. I'm still looking though, btw do other mobiles that support android have the same problem when loading an image? On Tue, May 8, 2012 at 7:10 PM, Justin Anderson wrote: > Ha, I thought you were talking to me (Justin) and

Re: [android-developers] Fitting image to a screen

2012-05-08 Thread Justin Anderson
Ha, I thought you were talking to me (Justin) and that you just got my name wrong... Didn't notice the post from Jason. But still... you should do your own research first. Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Tue, May 8, 2012 at 9:10 AM, Just

Re: [android-developers] Fitting image to a screen

2012-05-08 Thread Justin Anderson
> > Can you provide me with a link that could hlp me find the correct > orientation of Bitmap image, then upon finding this orientation i will > rotate the image. > Nope, sorry... I've never done that before and I'm not going to do your homework for you... I would just be using google to find answ

Re: [android-developers] Fitting image to a screen

2012-05-08 Thread Mohamed ElSanousi
Hi Jason, Can you provide me with a link that could hlp me find the correct orientation of Bitmap image, then upon finding this orientation i will rotate the image. Thanks On Sun, May 6, 2012 at 11:52 PM, Jason Teagle wrote: > I don't think my rotation is code is executing very well, because I w

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
I don't think my rotation is code is executing very well, because I was testing now. I took a picture in an Upright Position and when i loaded it it was sideways and stretched. Oh dear! Hopefully the image without manipulation will be a good point to re-start figuring it out. One other thi

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Mohamed ElSanousi
Alright I will try what you told me. I don't think my rotation is code is executing very well, because I was testing now. I took a picture in an Upright Position and when i loaded it it was sideways and stretched. One other thing is that when I load the picture I can't move any of the handlers. Whe

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
Believe it or not the project is running again :S, I've seen plenty of weird stuff - I believe you {:v) Check the attachment, what I'm trying to do for my project works perfectly in the emulator but not the Samsung S2 Galaxy. I'm basically trying to load One possible answer for this (workin

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
I have to suggest that line 23 as you indicate is incorrect; there's no executable code there, not even if we assume it refers to the onCreate() definition. In the sample you gave us, possibilities for the problem reference include R, R.layout, 'enter', 'moe' and the result of new Intent(moe).

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Mohamed ElSanousi
Code: package project.moe; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.view.View.OnClickListener; import android.os.Bundle; public class Pro

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
so i did restart everything and still it doesn't want to run. And no i didn't change anything in my code. Very odd! Are you relying on any external resources, such as phone hardware, memory cards, etc.? Something that might have changed its state suddenly (thus, your code remains the same but

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
What is this error, my project suddenly doesn't want to execute, j"ava.lang. RuntimeException: Unable to start activity ComponentInfo{project.moe/ project.moe.ProjectActivity}: java.lang.NullPointerException".. I didn't change anything First, I suggest you restart Eclipse, disconnect your phon

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Mohamed ElSanousi
What is this error, my project suddenly doesn't want to execute, j"ava.lang.RuntimeException: Unable to start activity ComponentInfo{project.moe/project.moe.ProjectActivity}: java.lang.NullPointerException".. I didn't change anything On Sun, May 6, 2012 at 4:26 PM, Jason Teagle wrote: > For test

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
For testing purposes, I would suggest you temporarily put the camera code aside, and do some testing on a simply image loaded from resources. My reason for saying this is to remove any possible outside issues, and just concentrate on the scaling of an image. I see your code, which seems like it

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Mohamed ElSanousi
displaypicture.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(); //startActivityForResult(i, PICK_IMAGE_REQUEST_CODE); startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.Medi

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
After using the code, still if i take a picture sideways or in an upright position its not rotated. When I take a picture sideways and load, it shows up in an upright position but stretched. Like I said, show us the code where you take that picture from the camera, put it into an object, and t

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Mohamed ElSanousi
After using the code, still if i take a picture sideways or in an upright position its not rotated. When I take a picture sideways and load, it shows up in an upright position but stretched. On Sun, May 6, 2012 at 3:53 PM, Mohamed ElSanousi wrote: > > This is the code im using to rotate an image

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
This is the code im using to rotate an image, All that code does is determine the angle in degrees to rotate by - it doesn't actually try and rotate an image. Show us the code where you actually load / set the image into an object, and then how you attempt to apply the rotation angle you obta

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Mohamed ElSanousi
This is the code im using to rotate an image, public static float rotationForImage(Context context, Uri uri) { if (uri.getScheme().equals("content")) { String[] projection = { Images.ImageColumns.ORIENTATION }; Cursor c = context.getContentResolver().query( uri, projec

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Jason Teagle
So I have been trying to the give the user the ability to the rotate a picture, but still i haven't found much about it. Can you plz explain more to me. Thanks http://lmgtfy.com/?q=rotate+image+android -- You received this message because you are subscribed to the Google Groups "Android Devel

Re: [android-developers] Fitting image to a screen

2012-05-06 Thread Mohamed ElSanousi
Hi Justin, So I have been trying to the give the user the ability to the rotate a picture, but still i haven't found much about it. Can you plz explain more to me. Thanks On Wed, May 2, 2012 at 12:10 AM, Mohamed ElSanousi wrote: > Okay I will try doing that. Thanks > > > On Tue, May 1, 2012 at

Re: [android-developers] Fitting image to a screen

2012-05-01 Thread Mohamed ElSanousi
Okay I will try doing that. Thanks On Tue, May 1, 2012 at 11:59 PM, Justin Anderson wrote: > Oh okay. The other problem is that I need to take a picture sideways so >> that when I load it will be in an upright position. When I capture an image >> in an upright position, then load it sideways.. >>

Re: [android-developers] Fitting image to a screen

2012-05-01 Thread Justin Anderson
> > Oh okay. The other problem is that I need to take a picture sideways so > that when I load it will be in an upright position. When I capture an image > in an upright position, then load it sideways.. > Why not just provide the ability for the user to rotate the image? This is becoming very hec

Re: [android-developers] Fitting image to a screen

2012-05-01 Thread Mohamed ElSanousi
Oh okay. The other problem is that I need to take a picture sideways so that when I load it will be in an upright position. When I capture an image in an upright position, then load it sideways.. This is becoming very hectic, why is that hard to deal with pictures?? Thanks On Tue, May 1, 2012 at

Re: [android-developers] Fitting image to a screen

2012-05-01 Thread Justin Anderson
> > The returned pictured is stretched. > But it now fits the screen? If you want the image to take up the whole screen and the aspect ratio of the image doesn't exactly match the aspect ratio of the image then it is going to get stretched. There is no way around that if you are dead set on makin

Re: [android-developers] Fitting image to a screen

2012-05-01 Thread Mohamed ElSanousi
The returned pictured is stretched. On Tue, May 1, 2012 at 11:04 PM, Justin Anderson wrote: > What do you mean by distorted? > On May 1, 2012 12:41 PM, "Mohamed ElSanousi" wrote: > >> I'm doing a facial parameter software that doctors could use to extract >> angles and ratios of the nose. Thi

Re: [android-developers] Fitting image to a screen

2012-05-01 Thread Justin Anderson
What do you mean by distorted? On May 1, 2012 12:41 PM, "Mohamed ElSanousi" wrote: > I'm doing a facial parameter software that doctors could use to extract > angles and ratios of the nose. This is what i have so far, I even tried to > rotate the picture and still the returned image is distorted.

Re: [android-developers] Fitting image to a screen

2012-05-01 Thread Mohamed ElSanousi
I'm doing a facial parameter software that doctors could use to extract angles and ratios of the nose. This is what i have so far, I even tried to rotate the picture and still the returned image is distorted. Code: Bitmap b = BitmapFactory.decodeFile(getIntent().getStringExtra("imagePath" ));

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Jim Graham
One point here: the assumption I'm making is that this is for a wallpaper. On Mon, Apr 30, 2012 at 03:46:37PM -0600, Justin Anderson wrote: > > > > And if you're about to question that, I got this directly from Dianne > > Hackborn in a thread I > > started over a year ago (maybe two...I'm not eve

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Justin Anderson
> > Your joking, my whole project is depending. I need to resize this bitmap > to fit the screen size, because I want to do calculation on the picture :( > What kind of calculations are you doing? You should be able to do that without having to have the image fit the screen size. Thanks, Justin A

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Justin Anderson
> > And if you're about to question that, I got this directly from Dianne > Hackborn in a thread I > started over a year ago (maybe two...I'm not even sure now). > Do you happen to have a link to said thread? I have done image scaling before and have never run into this... My constraints were slig

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Mohamed ElSanousi
Your joking, my whole project is depending. I need to resize this bitmap to fit the screen size, because I want to do calculation on the picture :( On Tue, May 1, 2012 at 1:21 AM, Jim Graham wrote: > On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote: > > On Tue, May 1, 2012 at 1

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Jim Graham
On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote: > On Tue, May 1, 2012 at 12:16 AM, Justin Anderson wrote: > > On Mon, Apr 30, 2012 at 1:56 PM, Mohamed ElSanousi > > wrote: > > > > I want the selected picture that is passed to the new activity to fit the > > > screen size. I want

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Justin Anderson
http://lmgtfy.com/?q=android+get+pixel+dimensions+of+screen Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Apr 30, 2012 at 3:01 PM, Mohamed ElSanousi wrote: > > > Oh ok. And how will I get the actual pixel dimensions of the screen? I > really nee

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Mohamed ElSanousi
Oh ok. And how will I get the actual pixel dimensions of the screen? I really need your help Thanks On Tue, May 1, 2012 at 12:16 AM, Justin Anderson wrote: > I want the selected picture that is passed to the new activity to fit the >> screen size. I want to resize the bitmap to fit the screen e

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Justin Anderson
> > I want the selected picture that is passed to the new activity to fit the > screen size. I want to resize the bitmap to fit the screen exactly. > Well, then you would need some code to get the actual pixel dimensions of the screen... right now you have hardcoded values of 750. Keep in mind tha

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Mohamed ElSanousi
I want the selected picture that is passed to the new activity to fit the screen size. I want to resize the bitmap to fit the screen exactly. Thanks On Mon, Apr 30, 2012 at 11:10 PM, Justin Anderson wrote: > What exactly are you trying to accomplish? You said "the returned image > is stretched

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Justin Anderson
What exactly are you trying to accomplish? You said "the returned image is stretched and doesn't fit the mobile screen size" but I don't see anywhere in your code where you are doing anything with the screen size of the device... What exactly are you expecting and what exactly are you seeing? Th

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Mohamed ElSanousi
No. On Mon, Apr 30, 2012 at 10:53 PM, Justin Anderson wrote: > Are you putting the Bitmap in an ImageView? > > Thanks, > Justin Anderson > MagouyaWare Developer > http://sites.google.com/site/magouyaware > > > On Mon, Apr 30, 2012 at 12:44 PM, Mohamed ElSanousi > wrote: > >> >> >> Code: >> I h

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Justin Anderson
Are you putting the Bitmap in an ImageView? Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Apr 30, 2012 at 12:44 PM, Mohamed ElSanousi wrote: > > > Code: > I have this code in the Activity result, when the user hits load, it will > open the gall

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Mohamed ElSanousi
Code: I have this code in the Activity result, when the user hits load, it will open the gallery allow him to choose a picture. The selected pictured is passed to another activity, here is where i'm facing the problem. The picture doesn't fit the screen. Uri selectedimage= data.

Re: [android-developers] Fitting image to a screen

2012-04-30 Thread Justin Anderson
What have you tried so far? How are you loading the image? Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Apr 30, 2012 at 1:55 AM, Mohamed ElSanousi wrote: > Hi!! > > I'm trying to load a picture from the gallery and display, everything > works

[android-developers] Fitting image to a screen

2012-04-30 Thread Mohamed ElSanousi
Hi!! I'm trying to load a picture from the gallery and display, everything works fine except that the returned image is stretched and doesn't fit the mobile screen size? I need help, thanks alot :) -- You received this message because you are subscribed to the Google Groups "Android Developers"