android-imageview

How to make Images Larger (in height) in lazy list

谁说胖子不能爱 提交于 2019-12-19 10:03:46
问题 I m developing a book reader using the Lazy list project Here is Link Problem: I m getting this look of Lazy List Small pages in height and blurred image which is very difficult to read. I want this: It should look clear (not Blurred) and full page in height like this. I know: Lazy list loads the sample size of bitmaps. how can I get the images in full resolution which is about 600X921. I tried this but not helpful main.xml <ListView android:id="@+id/list" android:layout_width="wrap_content"

Android: Displaying .jpg image from sdcard using ImageView

你说的曾经没有我的故事 提交于 2019-12-19 09:23:50
问题 I am trying to display a .jpg from my sd card into an imageview in my layout. I dont get any errors, but nothing gets displayed. I would appreciate any help. Thanks EDIT: layout1 = (LinearLayout) findViewById(R.id.layout1Activity); String imgFile = Environment.getExternalStorageDirectory() + "/Apple.jpg"; Bitmap myBitmap = BitmapFactory.decodeFile(imgFile); ImageView myImage = new ImageView(this); myImage.setImageBitmap(myBitmap); layout1.addView(myImage); 回答1: do NOT access the SD card

Loading images in GridView using Universal Image Loader

亡梦爱人 提交于 2019-12-19 05:46:43
问题 I'm using the Universal Image Loader 1.8.6 library for loading dinamically images taken from web. The ImageLoaderConfiguration configuration is the following: ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()) .memoryCacheExtraOptions(480, 800) // default = device screen dimensions .threadPoolSize(3) // default .threadPriority(Thread.NORM_PRIORITY - 1) // default .denyCacheImageMultipleSizesInMemory() .memoryCacheSize(2 * 1024 * 1024)

How to set wallpaper from imageview

若如初见. 提交于 2019-12-19 04:38:14
问题 I am still can't find the way to set wallpaper that the image getting from ImageView. Anyone can show me the way to set phone wallpaper from android ImageView? Here is my code: ImageView Layout: <ImageView android:contentDescription="My Wallpaper" android:id="@+id/full_image_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:saveEnabled="true" /> Activity on Image View Please noted that the image that showing in FullImageActivity is getting from image

Rotate and scale a view based on one handle in Android

大兔子大兔子 提交于 2019-12-19 04:14:22
问题 I'm trying to rotate and scale a view based on one "drag" handle in Android. With the layout rotating, and the view resizing, the end result should be that the drag handle follows the users finger where ever it moves. This is based on combining these two questions: How to scale a view in android using a handle? Rotating around two points in android not working The only thing that seems wrong is the rotation code. Here is my activity code: public class MainActivity extends Activity { ImageView

Updating layoutParams not working

依然范特西╮ 提交于 2019-12-19 03:07:10
问题 I'm trying to calculate the dimension for this image, which will be downloaded from the web using this line imgLoader.DisplayImage(url, R.drawable.thumbnail_background, image); . The problem is that orgHeight becomes zero and you can't divide by zero. But why is this orgHeight 0? // Add the imageview and calculate its dimensions //assuming your layout is in a LinearLayout as its root LinearLayout layout = (LinearLayout)findViewById(R.id.layout); ImageView image = (ImageView)findViewById(R.id

Picture taken from camera or gallery when using in imageview its orientation getting changed, and sometimes vertically stretched in Android

我们两清 提交于 2019-12-19 02:42:16
问题 In my application I have to capture image from camera or import from gallery, show it in imageview in activity. Everything is fine, I am getting image from both and able to set it on imageview without any exception. But sometimes image is not getting scaled properly and gets vertically stretched or with orientation changed. Please help me out. Here is my code to decode image referred from official android documentation: public static Bitmap decodeSampledBitmapFromResource(File photoFile, int

Drag and drop images in gridview in android

强颜欢笑 提交于 2019-12-18 13:49:26
问题 I'am developing a sample android application to learn about drag & drop in android. On start of the app, i'am displaying few images on a grid view. Now i need to drag one image at a time over to the place of another. After dropping an image over another, the images should swap its places. How can i achieve it ? Please guide/help me. 回答1: You can easily achieve this by using thquinn's DraggableGridView You can add your custom layout public class DraggableGridViewSampleActivity extends Activity

How to zoom a textview in android?

房东的猫 提交于 2019-12-18 13:27:20
问题 Can anyone guide me to perform zoom in&out operations on multiple views in android ? I need to perform zoom in&out operations on touch of image, text views . What should be my parent layout? Here is the code to zoom an image on touch of imageview. How do i zoom a textview? Please help me. // These matrices will be used to scale points of the image Matrix matrix = new Matrix(); Matrix savedMatrix = new Matrix(); // The 3 states (events) which the user is trying to perform static final int NONE

Take photo w/ camera intent and display in imageView or textView?

落花浮王杯 提交于 2019-12-18 12:31:26
问题 I have a question about how to take an image using the camera intent (or camera API) and then bring the image into an imageView for me to display in my application. This is what I have so far. I setup a button Button btnPicture = (Button) findViewById(R.id.btn_picture); btnPicture.setOnClickListener(this); I setup a Camera method private void Camera() { Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, TAKE_PICTURE_CODE); intent