get the last picture taken by user

// Find the last picture String[] projection = new String[]{ MediaStore.Images.ImageColumns._ID, MediaStore.Images.ImageColumns.DATA, MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME, MediaStore.Images.ImageColumns.DATE_TAKEN, MediaStore.Images.ImageColumns.MIME_TYPE }; final Cursor cursor = getContext().getContentResolver() .query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, MediaStore.Images.ImageColumns.DATE_TAKEN + ” DESC”); // Put it in the image view if (cursor.moveToFirst()) { final ImageView imageView = (ImageView) findViewById(; String imageLocation = cursor.getString(1); File imageFile = new File(imageLocation); if … Read more

How to remove all lines and borders in an image while keeping text programmatically?

Since no one has posted a complete OpenCV solution, here’s a simple approach Obtain binary image. Load the image, convert to grayscale, and Otsu’s threshold Remove horizontal lines. We create a horizontal shaped kernel with cv2.getStructuringElement() then find contours and remove the lines with cv2.drawContours() Remove vertical lines. We do the same operation but with … Read more

Change iPhone UISlider bar image

You were right to use -setMinimumTrackImage:forState: and -setMaximumTrackImage:forState: methods. What you missed is that you should provide stretchable UIImage to them, the rest is taken care of automagically: UIImage *sliderLeftTrackImage = [[UIImage imageNamed: @”SliderMin.png”] stretchableImageWithLeftCapWidth: 9 topCapHeight: 0]; UIImage *sliderRightTrackImage = [[UIImage imageNamed: @”SliderMax.png”] stretchableImageWithLeftCapWidth: 9 topCapHeight: 0]; [mySlider setMinimumTrackImage: sliderLeftTrackImage forState: UIControlStateNormal]; [mySlider setMaximumTrackImage: … Read more