我有一個布爾值,它根據方法結果返回True或False。將文本更改爲True或False
我想製作一個大文本,每次根據該布爾值寫入TRUE或FALSE。
我該怎麼做?
這是一個爆裂相機。
事情是,我使用相機作爲按鈕,每次有人觸摸相機時它都會返回FALSE,並且每次相機拍攝照片時都沒有人將其設置爲黑暗,則會返回TRUE。
當FALSE發生時,相機將轉到另一個活動。
TRUE和FALSE事情工作得很好,但我只能在我的日誌中檢查它。
我只想要一個按鈕,而不是在應用程序UI中寫入文本。
public static boolean ImagemEscura(Bitmap img)
{
float totalpixel = img.getWidth() * img.getHeight();
float totalpixelescuro = 0;
for(int x = 0; x < img.getWidth(); x++)
{
for(int y = 0; y < img.getHeight(); y++)
{
int cor = img.getPixel(x, y);
if(SomaRGB(cor) > 90)
{
totalpixelescuro++;
}
}
}
return totalpixelescuro/totalpixel > 0.75f;
}
public static int SomaRGB(int cor)
{
return getRed(cor) + getGreen(cor) + getBlue(cor);
}
public static int getRed(int argb)
{
return argb >> 16 & 0xFF;
}
public static int getGreen(int argb)
{
return argb >> 8 & 0xFF;
}
public static int getBlue(int argb)
{
return argb & 0xFF;
}
}
郵政你寫的代碼來實現這一點。 – csmckelvey