2016-05-26 12 views
1

Ich versuche, ein Bild auf 80mm Papier zu zentrieren, aber es ist immer in der linken Position das ist, was ich ausprobiert habe. DankeStar Mikronics Zentrum Bild

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)); 

Antwort

0

Ich endete, die Grafik die Größe des Papiers machend. Also verwende ich 3 Zoll 80mm, also habe ich die Grafik 1200 Breite mal 250 Höhe gemacht und mein Bild auf dieser Leinwand zentriert, die das Bild für mich zentrierte.