Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camptured image is show low quality #36

Open
aviontechnology opened this issue Mar 15, 2018 · 0 comments
Open

camptured image is show low quality #36

aviontechnology opened this issue Mar 15, 2018 · 0 comments

Comments

@aviontechnology
Copy link

Hello,
thank you in advance,

i use this library to take camera image but image quality is not that much good.
i use below capture code

private boolean caputre() {

	String mPath = genSaveFileName(getTitle().toString() + "_", ".png");
	File imageFile = new File(mPath);
	if (imageFile.exists()) {
		imageFile.delete();
	}

	//sessionManager.setStringData(SessionManager.KEY_picturepath);
	sessionManager.putStringData(SessionManager.KEY_picturepath,mPath);

	// create bitmap screen capture
	Bitmap bitmap = textureView.getBitmap();
	//Bitmap bitmap = textureView.getDrawingCache();

	OutputStream outputStream = null;

	try {
		outputStream = new FileOutputStream(imageFile);
	//	bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);
		bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);

		outputStream.flush();
		outputStream.close();

	} catch (FileNotFoundException e) {
		e.printStackTrace();
		return false;
	} catch (IOException e) {
		e.printStackTrace();
		return false;
	}

	return true;
}

please give some solution to improve quality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant