Tag: pixel

Android canvas change some pixels color

I have a Canvas object at start. I need to change color of some pixels depending on their current color. How can I do that in a proper way? Details: I have my own class extended from ImageView. In onDraw(Canvas canvas) method I draw something with third party class and have only Canvas object with […]

How to get the X Y coordinates and pixel size of a TextView?

Given a TextView, is it possible to know at runtime the X and Y coordinates of where it is drawn? Is it also possible to know the size (width/length) in pixels?

android fast pixel access and manipulation

I’m trying to port an emulator that i have written in java to android. Things have been going nicely, I was able to port most of my codes with minor changes however due to how emulation works, I need to render image at pixel level. As for desktop java I use int[] pixelsA = ((DataBufferInt) […]

Different Layouts For Different Screen Sizes On Android?

So I made an app using in Eclipse using the Graphical Editor, AbsoluteLayout, fixed pixel values, etc… just bad practice in general. It defaulted to a 3.7in screen. Is there any way to design a separate layout for each screen size and have the program choose which to load based on said screen size?

how to get color at the spot(or pixel) of a image on touch event in android

I want to get the color of the spot or pixel where I will touch a image in Android. I searched a lot on net, but got nothing. Please anyone help me.

How do I figure out what size (in pixels) an image needs to be for Android to display that image correctly across devices?

I have two images I want to display within my app. The first image is to be full screen (as a background for the app). I have read the ‘Supporting Multiple Screens’ article on developers.android.com multiple times but, I am still at a loss as to what size the image should be for each dpi […]

How to convert DP, PX, SP among each other, especially DP and SP?

I have known the difference among DP, SP and PX. And after searching this topic, I found nothing satisfying me completely. Maybe this post is a duplicate, but I still want to know what is the formula of converting from DP to PX, and DP to SP, from SP to PX, from PX to SP, […]

Android background image size in pixel

I would like to create a background image for different resolutions in Android. So I need the values (in pixel) for ldpi, mdpi, hdpi,xhdpi and xxhdpi. It is important that the image will not be blurred. I have already read the Documentation about multiple screen support but there are sizes in dp instead of pixel.

Bitmap width/height different after loading from Resource

1st. i’am new to Android coding 🙂 What I do is I load an Bitmap from my res/drawable-mdpi with BitmapFactory.decodeResource(getResources(), R.drawable.cat_ground_01); after I Log out the width/height of the Bitmap it tells me an other value then the Bitmap realy is. That’s kinda difficult to place Bitmaps pixelperfect e.g. overlap a bitmap of an face […]

How to Get Pixel Colour in Android?

I’m using Intent to call and show an image from Gallery, and now I made it enable to get me the coordinates of the image in a TextView using these: final TextView textView = (TextView)findViewById(R.id.textView); final TextView textViewCol = (TextView)findViewById(R.id.textViewColor); targetImage.setOnTouchListener(new ImageView.OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.