We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
this seems to fix it and produces the correct pixel color
https://stackoverflow.com/a/46377322
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final View targetView = findViewById(R.id.colorSample); targetView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent ev) { // TODO Auto-generated method stub ImageView img = (ImageView) v; final int evX = (int) ev.getX(); final int evY = (int) ev.getY(); img.setDrawingCacheEnabled(true); Bitmap imgbmp = Bitmap.createBitmap(img.getDrawingCache()); img.setDrawingCacheEnabled(false); try { int pxl = imgbmp.getPixel(evX, evY); findViewById(R.id.colorSlot).setBackgroundColor(pxl); }catch (Exception ignore){ } imgbmp.recycle(); return true; } }); // setUp(); }
Sorry, something went wrong.
obtain pixel color via https://stackoverflow.com/a/46377322
d184af5
no longer uses EyeDropper refer to Madrapps/EyeDropper#9
kishorekumarek
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: