Android :: 1.6 Camera Rotation / Image Size
Oct 21, 2009
My application while compiled in 1.5 works fine. I had some memory issues w/ 1.6 due to image size, which was strange b/c the image size increased when taking photos by taking a picture w/ surfaceholder/imagecapture callback. I seem to have fixed re-displaying those images by resizing them using a bitmapfactory matrix. But my camera is now rotating everything 90 degrees. It appears that my Override of surfaceChanged does nothing, which is where I was setting rotation at 90 (I can't remember why, it was 10 months ago!). I have tried at rotating the camera parameters paramters at 90 degrees, 0 degrees.
View 2 Replies
Aug 17, 2010
At the moment I am attempting to set my camera on my Motorola Droid phone to take an image that matches the size of my screen (854 x 480 pixels), and I am attempting to accomplish via the parameters for the camera as such:
CODE:.................
I have my activity implement the Camera.PictureCallback method of onPictureTaken (excluding log calls), so when the takePicture method is called it runs this method:
CODE:..........
For some reason though, my camera is taking pictures in 1280 x 960. Is this some sort of minimum size the camera can capture an image in? From log calls I can see that the Camera's parameters are still set to have a picture size of 854 x 480, but image keeps coming out as 1280 x 960. Am I decoding the image incorrectly, am I setting the camera's parameters incorrectly, or am I doing something else wrong?
View 1 Replies
View Related
Jan 8, 2010
I managed to figure out how to get the camara application to give me an image, but it is rather tiny, only 18k. Has anyone figured out a reliable way to get a full-sized image returned if you are using a MediaStore.IMAGE_CAPTURE intent?
View 2 Replies
View Related
Nov 16, 2010
I have an ImageView which I want to always be the same size. If the image is smaller than the view, I'd like it to be centred in the view. If the Image is larger than the view then I'd like it scaled down - with aspect ratio preserved.I've had several attempts at this myself
View 2 Replies
View Related
Sep 23, 2010
So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount. I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using Drawable.setBounds(). I've tried setting in the XML and programmatically, but neither worked. I'm very surprised setting max width/height didn't do anything. Below is the XML I'm using ImageView definition in my layout file
View 1 Replies
View Related
Jan 22, 2009
if size of image is larger than or smaller than specified display size (on screen), then it is automatically, compressed and stretched resp by android run time or require to handle by explicitly.
View 2 Replies
View Related
Feb 23, 2010
I spend two weeks now trying to get this working with no success. Here is what I want to do: I have several geo points around the user and his phone. I want to display this point overlaying them on the input from the camera (kind of standard AR (Augmented Reality) app). Part of my requirements are that the user can use the phone in either landscape or portrait mode.My plan was like this.
1. Register for Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_MAGNETIC_FIELD 2. Pass the result to Sensor Manager.getRotationMatrix(), getting back the R matrix that should be telling me how to translate points from the Phone coordinate system (defined here: http://developer.android.com/reference/android/hardware/SensorEvent.html) to World coordinate system (x -> East, y -> North, z -> Sky) 3. I want to translate points from World to Phone so I take the inverse of R (I'm using Matrix.invertM()) to get R_In 4. Using the GPS I translate the geo points I want to display on the camera to points in the World coordinate system and then I run them through the R_In matrix to get their coordinates in the Phone system. 5. Draw the points in the screen only if the have (phone coordinates) z < 0 and x and y such that they are visible. This is my grand plan... however I have problems quite early (2). I do get the R matrix back and it looks good when I align the phone to the world coordinate system ( I get the identity matrix ). However when I try to translate an imaginary point from the Phone coordinate system say (0, 1, 0) to the World coordinate system I don't get the numbers I expect.
View 2 Replies
View Related
Aug 23, 2009
I would appreciate to hear from you what would be the available options in Android to perform a lossless jpeg rotation of a jpeg image -> Rearranging the image data from landscape to portrait by rotation without ever fully decoding the image. My problem is that my device's camera always take the images in landscape mode and sometimes I would need to rotate the image to portrait to be used in my application. This takes time and memory if I need to do it in the standard way (decode the image, apply rotation operation to the pixels and encode again). Doing it without decoding the image would bring a significant improvement in performance. I have seen that in Android platform (Cupcake) jpegtran.c (which performs this operation beautifully) is available under /external/jpeg but this functionality is not available (a.f.a.k) on the application framework. How can I use this function? I guess I need to use JNI to be able to access this functionality, right? Other ways? Could you give me any hint on how I could do this or if there is another easier and quicker way to do it?
View 2 Replies
View Related
Nov 15, 2012
I've got a Samsung Galaxy III and have problems trying to view images in my gallery using the auto-rotate screen option and rather then having to manuallly press the rotate screen "icon" which does gets annoying. I just want to tilt my phone so the images can automatically change to portrait or landscape on its own depending what angle the phone tilts. I've ensure the auto-rotate screen is checked from Settings under Display and even tried unchecking it and checking it again as well as switching my phone on/off.
NOTE: That the auto-rotate screen option does work fine for me with everything else like watching videos, texting, internet browsing, music and even viewing the overall images in the gallery but when going in and viewing the pictures individually from either the Gallery or the Camera. All I've got is a rotate screen "icon" to press on manually each time I'd like the picture to be portrait and if I want landscape I have to press on the screen rotate icon again. I noticed the auto-rotate screen option doesn't work on my Home Screen and Lock Screen as well but that isn't the main issue.
I've been reading around and tried pulling out my battery on "Odin" mode, wait 30sec-1min then turn my phone on again and that didn't work. I've also did the same procedure and ensure I unchecked the auto-rotate screen option and checked it again after I turned on the phone. I tried the Gyroscope Caliberation option and calibrated it and that didn't work either. My sister has the same phone as me with the same version installed but she doesn't have this problem and I'm wondering if it's something to do with how my phone software's set up?
View 2 Replies
View Related
Oct 27, 2009
I'm using a Rotate Animation to rotate an image that I'm using as a custom cyclical spinner in Android. Here's my rotate_indefinitely.xml file, which I placed in res/anim/:
<?xml version="1.0" encoding="UTF-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:from Degrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:duration="1200" />
When I apply this to my ImageView using AndroidUtils.load Animation(), it works great!
View 3 Replies
View Related
Feb 10, 2009
I have created a custom icon bar in Android using the XML layout creator, using a RadioGroup within a LinearLayout (XML included below). Each RadioButton within the RadioGroup has a custom drawable (with checked and unchecked states) as its android:button attribute. The Linear layout is itself within a RelativeLayout so that it can appear at an arbitrary position on the screen (as a side bar, in this instance).The drawables are 55 pixels wide, and the android:layout_width attribute of all these views is "wrap_content".When I make this component visible, aligned to the bottom-left of the screen, only about three-quarters of the RadioButton image widths are visible. Setting the layout_width of the RelativeLayout to "fill_parent" rectifies this and causes the full button to appear.However this means that the button group consumes click events across the entire width of the screen. How can I make the entire button appear, and have only the area of the button respond to clicks? Hard-coding the width of the drawable is not a particularly desirable solution.<RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width ="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:id="@+id/LinearLayout02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_below ="@+id/LinearLayout01" android:visibility="invisible"><RadioGroup android :id ="@+id/ RadioGroup01" android:layout_height="wrap_content" android:checkedButton="@+id/RB01" android:layout_width="fill_parent">
<RadioButton android:id="@+id/RB01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR01"/><RadioButton android:id="@+id/RB02" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR02"/>
<RadioButton android:id="@+id/RB03" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR03"/> <RadioButton android:id="@+id/RB04" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR04"/> </RadioGroup></LinearLayout>
View 2 Replies
View Related
Nov 15, 2010
Principle of the image to be displayed: *Bitmap _scratch = BitmapFactory.decodeResource (getResources (), R.drawable.skalyzmn); canvas.drawBitmap (image, x, y, null);*
How to use this method to reduce or increase the picture?
What you need to add that the picture was of such size that I want?
View 1 Replies
View Related
Feb 2, 2010
I have an image that I want to place on the background on my activity. For the G1 I would use a background of 320x480 but with the nexus 1 the resolution is almost double that. Should I just place the large image and make the smaller phones size down? I am trying to keep the size of my package down as much as possible.
View 1 Replies
View Related
Jun 22, 2009
I want to reduce the size of my image file to transfer it over the network. Do anybody know how can I reduce the file size using andriod APIs.
View 3 Replies
View Related
Oct 4, 2010
I'm trying to get the real size of an image displayed in an image view. Actually my image is larger than the screen and the imageview is resizing the image to diplay it. I'm looking for this new size.I've tried to override the onDraw method of the ImageView in a custom view but I'm not getting the correct height and width.
View 8 Replies
View Related
Mar 29, 2010
I'm trying to draw an image in an ImageView, but i want it to be unscaled, with scrollbars as necessary. How can I accomplish this? Right now I just have a drawable set as the android:src of the ImageView in the XML. This autoscales the image to fit the screen width.
View 2 Replies
View Related
Sep 15, 2010
I am running into a very weird thing. I have an ImageView, and when I call setImageURI with an image, it seems to change the size of the image view.
CODE:..............
The default image is 195 x 195, i am trying to set the image to be 200 x 200, after setting the image using setImageURI, i get the dimensions back and it says it's 48 x 48.
I have tried a bunch of different android:scaleType parameters, and I couldn't find anything that worked.
I also tried explicitly setting the size (layout_width="200px") and it seems to work.
View 2 Replies
View Related
Sep 12, 2010
I am a bit confused on creating an image which will be acting as a background for my activities. So, in short, my aim is that my application should be able to fit the different screen sizes. Therefore, what size in pixel should my three images be to be able to fill the screen of the device in ldpi, mdpi and hdpi?
View 2 Replies
View Related
Oct 5, 2010
I am looking for an optimized solution to display image in different screen size. I have a image in server which I would like to display in different handled devices like iPhone, iPad ,Android based tablets or mobiles etc.
View 1 Replies
View Related
Sep 6, 2010
I want to display image in center and top and bottom in same size refer bellow screens,anybody know please give the code to me..
View 1 Replies
View Related
Jul 13, 2010
I have an image that I want to be able to display full size but when I place it in my imageview it scales. I would like it to display full size with scroll bars. Is there a way I can make my main view that the image view is in have scroll bars vertical and horizontal or how can I do this. The images are local on the SD card. I would really like to get the same effect that the webview offers if i were to look at these image from a URL.
View 3 Replies
View Related
Jul 5, 2010
I'd like to be able to use an image as my background in a relative layout, without it stretching. I don't want to just enter the images details into an XML file, as I want to use different images, with different sizes. I've tried the following, but it just stretches the images (I know the left, top, right and bottom variables have the wrong values, but I've just entered something into them, as a test to see if it makes any difference to the output, but it does not. If it did, I'd calculate the correct values programmaticly : -
RelativeLayout explosionlayout = (RelativeLayout) findViewById (R.id.explosionlayout);
imageAnim = (ImageView) findViewById(R.id.explosion);
Drawable d;
d = this.getResources().getDrawable(R.drawable.bomb);
int left = 10; int top = 10; int right = 20; int bottom = 20;
d.setBounds(left, top, right, bottom);
explosionlayout.setBackgroundDrawable(d);
View 1 Replies
View Related
Oct 30, 2010
I want to design some mockup interfaces for some Android apps. I would like them to be able to nicely scale up and down depending on the resolution of the mobile device being used.
What would be the best image size to design these mockup interface in?
View 2 Replies
View Related
Nov 24, 2010
If there is a image on my phone that I want to send up to a server thats 1mb or higher I want to take that image and shrink it to a smaller size without messing with original image in anyway. I know how to get a from the phone and I also know how to send it up to a server, I just need to know how to make the image smaller because large files higher than 1mb are giving me issues.
View 1 Replies
View Related
Apr 30, 2010
How to fix the image size(28 x 29 png file) in the grouptIndicator of the ExpandableListview ??? I use expandableListview and android:groupIndicator in the attribute. The png image size is 28x29. But The Imgae is stretched. Does anyone Know this? Any answer is useful for me .
View 3 Replies
View Related
Nov 11, 2010
I am trying to develop an app for which I want multiple screen support. I have read the Android article on Best practices for Multiple Screen Support. As per the article we have to follow 3 important things:
1. Mention support for different screen sizes (large, medium and small) and any density in AndroidManifest.xml.
2. Place images of 3 dpi's (120, 160, 240) in 3 folders res/ldpi, res/ mdpi and res/hdpi.
3. In layout's the dimension should be mentioned in "dip" units. Then Android will take care of the scaling on its own.
I have implemented all these points in my project. The images are picked up correctly from the appropriate folders. But the arrangements of the controls in not same. e.g. I ran the app on three emulators 1. Resolution 240*320 dpi 120. 2. Resolution 240*320 dpi 160. 3. Resolution 240*320 dpi 240. (All the emulator have same resolution but different density). The problem is the position of the controls is not same on all the three emulator. As per my understanding if the android:layout_marginLeft and android:layout_marginTop are mentioned in "dip" then this problem should not occur. As the density of the emulator increases the controls get placed more towards the right. Is it necessary that I provide layouts for all combinations of dimensions and density i.e. in layout-small, layout-large, layout- medium, layout-long,layout-notlong?
View 2 Replies
View Related
Oct 29, 2010
I'd like to use a 1x1 size Nine-patch image from Android drawable resources. When I'm trying to display it with <ImageView> in my layout xml file, this one is never showing up on the Android emulator device. Here's the xml code below. Code...
View 1 Replies
View Related
Nov 20, 2009
Whats the default screen width of android devices? I took a 320 x 460 image for my splash screen, it did not cover the entire screen!
View 6 Replies
View Related
Mar 1, 2010
Some of you may met the same problem, I was using BitmapFactory.decodeStream, and got this exception: Code...
I know the reason is because the BitmapFactory is trying to decode an uncompressed version of a big image(in my situation, jpg). I can use BitmapFactory.Options.inSampleSize to fix it. but my question is what's the maximum size that VM would like to allocate for loading a image with BitmapFactory? so I can do some scale before it loads.
View 2 Replies
View Related
Jul 23, 2012
When I was on stock Xperia Gingerbread 2.3.4 on my ST17i, the average image file size I take is only playing around 300 to 600kb each However, after flashing the MiniCMSandwich Lite AOSP rom, the file sizes have been bumped to an average of 1.3mb. I want to know why? As far as I know, on both stock and MiniCMSandwich, I've set the resolution to the highest (5 megapixels).
Is it a matter of the camera apps? (Xperia camera and stock camera).how big your average file sizes are for 5mp of images.
View 9 Replies
View Related