android-imageview

Circular Imageview in android

时间秒杀一切 提交于 2019-12-13 09:37:14
问题 I want circular ImageView in my app. I found some code but this is only round the corner image not to circle. Here is my code. Also check the image. public class CircularImageView extends android.support.v7.widget.AppCompatImageView { public CircularImageView(Context context) { super(context); } public CircularImageView(Context context, AttributeSet attrs) { super(context, attrs); } public CircularImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle);

Pick an image from the image gallery in android?

我的未来我决定 提交于 2019-12-13 09:18:18
问题 I am naive in android.I am facing a nuNullPointerException when i picking an image from the gallery.my code is following like that and getting error in cursor and filePathColumn[0] . What to do.. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_IMAGE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore

Resize bitmap without creating new bitmap

江枫思渺然 提交于 2019-12-13 07:37:52
问题 Is there anyway to resize/scale bitmap without creating a new bitmap? Let say i download image that height or width is larger than 2048px. Before i can display it, i have to resize it because ImageView does not support bitmaps larger than 2048px. If i use Bitmap.createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter) it gives me a new bitmap. Now we have two bitmaps, original and scaled. Thats when my application runs out of memory. Below is the code which i use right now.

How can I set the ImageResource of a child grid in customized gridView

前提是你 提交于 2019-12-13 06:23:35
问题 I am trying to set the ImageResource of a grid in customized gridView. ImageView imageView = (ImageView) gridview .findViewById(R.id.grid_item_image); imageView=(ImageView)gridview.getChildAt(10); setImage(imageView); where setImage(img) is a method defined like this public void setImage(ImageView imageView){ imageView.setImageResource(R.drawable.ycoin); } but I am getting java.lang.ClassCastException: android.widget.LinearLayout error. xml part of GridView <GridView android:id="@+id

Android touchevent— need help/suggestion according to scenario

女生的网名这么多〃 提交于 2019-12-13 04:58:33
问题 Now I have an ImageView and its a circle which is at the slightly below than center position (But this should not matter). I have written code onTouch of ImageView for ACTION_DOWN,ACTION_UP ,now consider as user have put finger on circle and move and move.... I want to active some code when user move finger and exceed the region of CIRCLE image(As soon as user exceed the region the code should be ececuted onlly once) Here is my code ImageView view1 = (ImageView) findViewById(R.id

How to get degree of rotation of image

为君一笑 提交于 2019-12-13 04:56:31
问题 I'm getting an image from gallery and display it in an imageView. Sometimes, image displays 90 degrees CCW. So, my question is: 1- is it possible to get angle of rotation of image? 2- is it possible to get angle by a face detection library? if yes, which library you suggest? any recommendation would be appreciated. Thanks. 回答1: Okay, I found a solution that I share it with you. public class ImageCorrection extends Activity { private final static String TAG = MainActivity.class.getSimpleName()

how to use custom ImageView

亡梦爱人 提交于 2019-12-13 04:44:46
问题 I have found the following code on how to get display height and width from ImageView: Trying to get the display size of an image in an ImageView . When I try to use it in the layout snippet below, I get following error. <com.mycompany.widget.SizeAwareImageView android:id="@+id/account_profile_img" android:layout_width="wrap_content" android:layout_height="match_parent" android:background="@drawable/avatar" android:clickable="true" android:gravity="bottom|center_horizontal" android:onClick=

Picture from gallery to an imageview

怎甘沉沦 提交于 2019-12-13 04:35:30
问题 i'm trying to select an image from gallery to an ImageView but it doesen't work. Here's the code: public class Profilo extends MainActivity { private ImageView img; private Bitmap bmp; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.profilo); img = (ImageView)findViewById(R.id.profile_image); img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(Intent.ACTION_GET

Making a gallery with automatically generated ImageView s in Android

自古美人都是妖i 提交于 2019-12-13 04:35:30
问题 I'm writing an Android application for taking photos with camera and generating ImageView s for previewing them. This is how I take pictures and put them in ImageView : public class TakePhoto extends Activity { private static final int CAMERA_REQUEST = 1888; Button btnCaputre; ImageView image; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_take_photo); btnCaputre = (Button)findViewById(R.id.btnCapture); image

Android ViewPager not filling screen on Galaxy Nexus only

折月煮酒 提交于 2019-12-13 04:21:58
问题 I'm trying to create a ViewPager that takes up the entire screen. Inside each fragment of the ViewPager, I have an ImageView that displays a semi-transparent picture. For some reason, when I try my solution on a Galaxy Nexus (4.0.4), it leaves a border on the left and right side of the ViewPager, as shown below: I've tried this on the following devices and it does not give that problem: Nexus S (4.1.1) Nexus One (2.3.6) Evo 4G (CM7.2, 2.3.7) Android emulator Would anyone be able to take a