imageview

Drag ImageView Or Bitmap Upon Touch

喜欢而已 提交于 2019-12-23 04:50:21
问题 I currently have something working where I can drag a box horizontally on the screen (what I want it to do). However, it works when you click ANYWHERE on the screen, and I want it to work only when the box has been clicked. I have tried implementing this in different ways, and I've looked all over the place and still remain lost. Can anybody help? I also can't figure out how a bitmap is placed (I'm using a bitmap right now as I can't for the life of me figure out how to implement the

Center drawable and scale height

隐身守侯 提交于 2019-12-23 04:30:14
问题 Since I want to support tablets and smartphones without delivering a special "HD" version, I need to scale my Images depending on the resolution of the users device. This is the ImageView source that looks good on the Samsung Galaxy Nexus: <ImageView android:id="@+id/character" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:background="@android:color/transparent" android:scaleType=

Round cornered ImageView supporting background color in Android?

瘦欲@ 提交于 2019-12-23 03:46:34
问题 I want to do a round corner ImageView . But I want it have background color (e.g., #000 ). With current solutions (either build an extended round corner view or paint a round corner bitmap) the background property will spoil the effect, as the view will be in a black rectangle (see the below image). Is it possible to realize such a view that the background zone is also round cornered? PS, why I want a background color: I allow users to upload non-square images but my image view zone is square

How to share an image on whats app which is set on an ImageView in android

孤街醉人 提交于 2019-12-23 02:31:17
问题 I have an image(downloaded via internet) set on an imageview in my code. I am gettting this image via json. I want to share this image on whats app, but i do not know the file name or its path. I have tried this code Intent share = new Intent(Intent.ACTION_SEND); share.setType("image/*"); share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(root.getAbsolutePath() + "/DCIM/Camera/image.jpg")); startActivity(Intent.createChooser(share,"Share via")); But as you see it is passing a filepath,

How to share an image on whats app which is set on an ImageView in android

狂风中的少年 提交于 2019-12-23 02:30:12
问题 I have an image(downloaded via internet) set on an imageview in my code. I am gettting this image via json. I want to share this image on whats app, but i do not know the file name or its path. I have tried this code Intent share = new Intent(Intent.ACTION_SEND); share.setType("image/*"); share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(root.getAbsolutePath() + "/DCIM/Camera/image.jpg")); startActivity(Intent.createChooser(share,"Share via")); But as you see it is passing a filepath,

Image viewpager swiping

心已入冬 提交于 2019-12-23 02:21:23
问题 I have a problem with swiping images horizontally in view pager. I'm using Universal Image Loader for displaying images. View pager is positioned under the textview that represents title of the story and on top of other textview that represents story. The problem is that swiping isn't working exactly how it should be. Every time I try to swipe to right or left, the image swiping is interrupted by scrolling of the whole layout. To be more specific, layout of my activity is scrollable

svg-android imageview not working

泪湿孤枕 提交于 2019-12-22 19:58:22
问题 I have a need to show svg files in my android app. svg-android seems like the only library that has any documentation and thus my first approach. The only example available demonstrates how to create an imageview attach an svg image and attach it to the main content view. I however want a svg file to show up on a RelativeLayout I already have defined. I attempted an implementation like so: ImageView imageView = new ImageView(this); SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw

When I capture image from camera it lost the quality of image? What to do?

女生的网名这么多〃 提交于 2019-12-22 18:41:09
问题 My code for clicking on an image is: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, 300); Code of Activity Result: if (requestCode == 300) { Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, bytes); File destination = new File(Environment.getExternalStorageDirectory(), System.currentTimeMillis() + ".jpg"); FileOutputStream fo; try

When I capture image from camera it lost the quality of image? What to do?

末鹿安然 提交于 2019-12-22 18:41:03
问题 My code for clicking on an image is: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, 300); Code of Activity Result: if (requestCode == 300) { Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, bytes); File destination = new File(Environment.getExternalStorageDirectory(), System.currentTimeMillis() + ".jpg"); FileOutputStream fo; try

Image is not loaded using Glide

两盒软妹~` 提交于 2019-12-22 18:26:26
问题 I have a vector image. If I want to set the image to ImageView, the picture is not loaded. code: Glide.with(this).load(R.drawable.vector_image).into(imageView) However, when I use: imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.vector_image)) and it is working. Any ideas? 回答1: Glide doesn't support vector drawables yet. So implementing vector drawables you have to do yourself. For reference you can check below links for this issue reported by developers on github: link