2016-05-26 1 views
1

私は80mmの紙に画像を集中しようとしていますが、それは常に左の位置にあります。これは私が試みたものです。ありがとうスターミクロンセンターの画像

AssetManager assetManager = mContext.getAssets(); 
    InputStream istr = null; 
    try { 
     istr = assetManager.open("www/img/logo.jpg"); 
    } catch (IOException e) { 
     e.printStackTrace(); 
    } 

    Bitmap bm = BitmapFactory.decodeStream(istr); 

    StarBitmap starbitmap = new StarBitmap(bm, false, 200); 
    commands.add(new byte[] { 0x1b, 0x61, 0x01 }); //align center 
    commands.add(starbitmap.getImageEscPosDataForPrinting(false,true)); 

答えて

0

私は紙のサイズをグラフィックにした。だから私は3インチ80ミリメートルを使用するので、私は250の高さでグラフィック1200の幅を作って、私のために画像を中心にそのキャンバス上に私のイメージを中心に。