i working on creating online image editing tool.looking refernce how can add image white space on right side.for example see image
presumably, want create new image existing image, new image has white space on left , right?
suppose unpadded image bufferedimage , called 'image'. suppose amount of whitespace want on each side 'w'. want create new bufferedimage wider original, paint entire thing white, , draw smaller image on top of it:
bufferedimage newimage = new bufferedimage(image.getwidth()+2*w, image.getheight(), image.gettype()); graphics g = newimage.getgraphics(); g.setcolor(color.white); g.fillrect(0,0,image.getwidth()+2*w,image.getheight()); g.drawimage(image, w, 0, null); g.dispose();
Comments
Post a Comment