I do have long ruler image (shown below) that I need to use as scrollable view on android device.
Can some one please advice for the best way to do the same?
I tried this in two ways,
Initially I tried to put image as background to scroll view but that didn't work as image is too long/large.
Currently I am trying to use BitMap class to crop my image and use the part what I want to display. But again an issue is on every scroll need to crop another part of image and display the same such a way that it will not reflect on screen.
ImageView image = (ImageView) findViewById(R.id.imgScaleFirst);
Options opts = new Options();
opts.inDither = true;
opts.inPreferredConfig = Bitmap.Config.ALPHA_8;
opts.inScaled = false; /* Flag for no scalling */
/* Load the bitmap with the options */
//Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.lbs_ruler_vert_left,opts);
Bitmap bmap= BitmapHelper.decodeFile(getResources().openRawResource(R.drawable.lbs_ruler_vert_left),182, 4096, true);
I appreciate your input/idea for same.
Please check https://dhingrakimmi.wordpress.com/2015/09/17/android-measurment-scale-my-scale/?preview_id=2 This will show scale without any limit.
I found this link while searching for a similar requirement to draw a ruler. Hope this helps someone in future.
The idea here is to create a custom view and use canvas to draw lines at appropriate intervals.