我有一个RGB bufferedImage bImg.
我想将bImg转换为灰色图像.
BufferedImage grayIm=new BufferedImage(bImg.getWidth(null), bImg.getHeight(null), BufferedImage.TYPE_BYTE_GRAY);
Run Code Online (Sandbox Code Playgroud)
我试过这个grayIm但是我不能为这个grayIm设置灰度值.
我正在使用Robot类发送keyevents.我试过robot.keyPress()功能.但我无法弄清楚如何发送CTRL+ zkeyEvent.
logcat的:
12-05 23:37:01.721:W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): error - Read-only application cannot POST
12-05 23:37:01.721: W/System.err(534): request - /1/statuses/update.json
Run Code Online (Sandbox Code Playgroud)
虽然我可以通过(getScreenName()函数)读取屏幕名称并设置读取,写入我的twitter应用程序的权限,但它给出了上面的logcat.And我正在使用twitter4j jar文件.
我很困惑,一个线程在执行return语句后自动停止,或者它仍然存活.这是代码:
public void run{
//code goes here
return;//does the thread stops here;
}
Run Code Online (Sandbox Code Playgroud) 我想对灰度图像进行某种图像处理.
BufferedImage bImg = new BufferedImage(img.getWidth(null),img.getHeight(null),BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g=bImg.createGraphics();
g.drawImage(img,null,null);
Run Code Online (Sandbox Code Playgroud)
我正在使用(BufferedImage.TYPE_BYTE_GRAY)此类型来获取灰度图像
但我不知道如何设置此灰度级BufferedImage的值.