【问题标题】:I can't save an barcode image to the folder, I just keep getting this black screen after I save information我无法将条形码图像保存到文件夹中,我保存信息后一直黑屏
【发布时间】:2018-12-30 10:27:55
【问题描述】:

这是条码生成随机条码的代码

$barcode = substr(number_format(time() * rand(),0,'',''),0,13);

$barcodeimg = $barcode.".png";

$stud->generateBarcodeImage($barcode,20,"horizontal","code128","");

我没有得到这个代码,我会研究这个,但我想不通

        // Draw barcode to the screen
        header('Content-type: image/png');
        imagepng($image, "barcode/".$text.".png");
        imagedestroy($image);

【问题讨论】:

    标签: php image barcode


    【解决方案1】:

    假设您将图像数据正确保存在$image 中。并且你想将图像输出到屏幕上,不要指定imagepng($image);中的最后一个参数

    【讨论】:

    • 我的错,我不想在屏幕上输出条形码图像,保存信息后,它会创建图像并保存在条形码文件夹中。
    • 嗨,嗯,我已经设法将创建的条形码图像保存在文件夹中,这是我的目标,但是黑屏仍然存在,就像损坏的条形码图像一样,我只想删除这个黑屏图像的东西,这样我每次保存信息时都不会刷新页面,
    猜你喜欢
    • 2013-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多