How to Print Images with a POS Printer: Difference between revisions

From wizarPOS
(Created page with "* Put image to the assets folder of the application project. * Call print image api to print, snippet code is as follows: <syntaxhighlight lang="java"> public void printBi...")
 
(Replaced content with "{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/printer/print-images}}")
Tag: Replaced
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
* Put image to the assets folder of the application project.
{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/printer/print-images}}
* Call print image api to print, snippet code is as follows:
<syntaxhighlight lang="java">
    public void printBitmap(Map<String, Object> param, ActionCallback callback) {
        Bitmap bitmap =null;
        try {
            bitmap = BitmapFactory.decodeStream(mContext.getResources().getAssets()
                    .open("photo.bmp"));
        } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        try {
            device.printBitmap(bitmap);
            sendSuccessLog(mContext.getString(R.string.operation_succeed));
        } catch (DeviceException e) {
            e.printStackTrace();
            sendFailedLog(mContext.getString(R.string.operation_failed));
        }
    }
</syntaxhighlight >

Latest revision as of 07:41, 7 April 2024

Please visit new link of same subject:

https://smartpossdk.gitbook.io/cloudpossdk/faq/printer/print-images

We're making a move! Our site's content is migrating to a new URL, to provide you with an enhanced browsing experience. Please update your bookmarks accordingly. Thank you for your continuous support!