简体   繁体   中英

How to create image file in specific location with particular height and width in java

I am implementing the project where i am detecting rectangular object from image. I want to store that part to memory. As the height and width every time i get is not predictable, i am not getting how to store that part of matrix by creating the image file at sd card that will exactly occupy the rectangular object

how can i create image eg . demo.jpg in //temp/ of size 90x50

use php GD function. use code like below

header ('Content-Type: image/png');
$im = @imagecreatetruecolor(120, 20)
  or die('Cannot Initialize new GD image stream');
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
imagepng($im);
imagedestroy($im);

take help from http://php.net/manual/en/function.set-error-handler.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM