誰でもこのエラーを修正する方法を知っていますか? コンストラクタ StarBitmap(Bitmap, boolean, int) は表示されません。このコードの 2 行目で発生します。
Bitmap bm = BitmapFactory.decodeResource(context.getResources(), R.drawable.euro_cert_black);
StarBitmap starbitmap = new StarBitmap(bm, false, 408);
これを修正する方法がわかりません。StarBitmapのインポートがあるかどうかを確認しましたが、あります。私が見つけたいくつかの回答から getResource() に変更しようとしましたが、まだ何もありません。public を StarBitmap コンストラクターに追加しようとしましたが、まだ何もありません。
私がこのコードを持っているクラスはpublic class Print{}
StarBitmap とコンストラクターは次のようなものです。
public class StarBitmap
{
int[] pixels;
int height;
int width;
boolean dithering;
byte[] imageData;
public StarBitmap(Bitmap picture, boolean supportDithering, int maxWidth)
{
if(picture.getWidth() > maxWidth)
{
ScallImage(picture, maxWidth);
}
else
{
height = picture.getHeight();
width = picture.getWidth();
pixels = new int[height * width];
for(int y=0;y < height; y++)
{
for(int x=0;x<width; x++)
{
pixels[PixelIndex(x,y)] = picture.getPixel(x, y);
}
}
//picture.getPixels(pixels, 0, width, 0, 0, width, height);
}
dithering = supportDithering;
imageData = null;
}
ちなみに、StarBitmap は、Star Micronics ポータブル プリンターの SDK からのものです。