I am attempting to split an image into pieces, lets say for example 16 chunks (4x4).Once i split the image how can i display these chunk image as a whole.
Should I use a bitmap or a drawable? Is there a method to split or will I have to make a custom method?
Open your browser in PDF free application web site and go to Splitter tool app. Click inside the file drop area to upload PNG files or drag & drop PNG files. You can upload maximum 10 files for the operation. Click on SPLIT button.
To split images in half in Photoshop, select the marquee tool by pressing M, then click and drag over half of your image to create a rectangular selection. With the selection active, right-click and select New Layer Via Cut. This will cut the image in half and place the selected half on a new layer.
If you want to divide your canvas into 3 equal columns using Guides, go into the View menu and choose “New Guide…” In the New Guide dialog box enter “33.33%” in the position field, and press OK. Then repeat the same process but this time enter “66.66%” in the position field.
Use bitmap because it holds pixel of the image which will be good for you for future use, if you are willing to display that image.
for example ---->
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
ImageView iv = (ImageView) findViewById(R.id.imageView1);
iv.setImageBitmap(bm);
------------------------------------EDITED PART--------------------------------------------
if you want to send image from place to another(one device to another), you to convert it into byte array like this --->
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.Compress.JPEG, 100, baos);
byte[] b = baos.toByteArray();
and then send this to the other device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With