Sending Image files and Text from android app java HttpURLConnection multipart form-data

Hi I am trying to upload a file and a text, using multipart form-data HttpURLConnection java, sample of code below: String boundary = UUID.randomUUID().toString(); final String LINE_FEED = “…

Recyclerview is not dispaying the image

I am using this code to display a preset image in recyclerview, but for some reason it wont display. If anyone has any fixes I would be greatly indebted to them if they share it. My Main Activty: …

How can I resize a rectangular image to a square image while maintaining aspect ratio in Java?

I need to resize rectangular images (400×600) into square images (600×600) while keeping aspect ratio of the original image. The newly added pixels need to be transparent. Like this. I need it in java …

Preload multiple images with Glide

We are trying to preload images into cache memory to load them later (the images are located in the Asset folder of the application) What we tried: Glide.with(this) .load(pictureUri) ….

How to improve image rotation quality in Graphics2D?

Currently I am using this code (which I found here) to rotate images in Java. The code works well, but I am not satisfied with the quality of the rotated image. How can I improve it? Do it need a …

JFrame Image, paint on top of it

I create a frame with an image with this code: JFrame f = new JFrame(); try { f.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new File(“image.jpg”))))); } catch (…

how do i use an image in java gui

Hi im making a Gui programme using a null layout and a setBounds() method for lay out . In the programme I want 25 strings printed out on the screen in random locations . I know that i could do this …

Watermarking with PDFBox

I am trying to add a watermark to a PDF specifically with PDFBox. I’ve been able to get the image to appear on each page, but it loses the background transparency because it appears as though PDJpeg …

Crop image to smallest size by removing transparent pixels in java

I have a sprite sheet which has each image centered in a 32×32 cell. The actual images are not 32×32, but slightly smaller. What I’d like to do is take a cell and crop the transparent pixels so the …