I have Bitmaps on my project and I want download my bitmap to gallery from url . How Can I ?
I did use this for create QR code
private Bitmap stringToBitmap(String content){
try {
QRCodeWriter writer = new QRCodeWriter();
BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, 512, 512);
int width = bitMatrix.getWidth();
int height = bitMatrix.getHeight();
Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
}
}
return bmp;
} catch (WriterException e) {
e.printStackTrace();
return null;
}
}
}
I want download bitmap to my gallery in there
@Override
public void onClick(View view) {
Intent i;
switch (view.getId()) {
case R.id.qrindir:
Bitmap imageResult = stringToBitmap(texttt.getText().toString());
//I want download bitmap in there
break;
}
}
I use this for stringtoBitmap
olustur.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Bitmap imageResult = stringToBitmap(texttt.getText().toString());
} });
}