找回密码
 立即注册

QQ登录

只需一步,快速开始

沙尘暴

初级会员

38

主题

111

帖子

319

积分

初级会员

积分
319
沙尘暴
初级会员   /  发表于:2016-12-15 11:43  /   查看:5957  /  回复:12

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

12 个回复

倒序浏览
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-12-15 13:34:24
沙发
你好,请问这个是偶发的还是一直这样,另外方便的话可以把图片发过来,方便分析
回复 使用道具 举报
沙尘暴
初级会员   /  发表于:2016-12-16 08:48:16
板凳
一直这样, 图片是用leadtools images 下的barcode1图片测试的。只要写就出错。
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-12-16 09:43:52
地板
好的,安装包提供了Barcode功能的DEMO,写入条码功能正常可用,你可以参考对比一下。如还有问题可用把代码打包发过来一起研究一下
回复 使用道具 举报
沙尘暴
初级会员   /  发表于:2016-12-20 15:53:44
5#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Leadtools;
using Leadtools.Barcode;
using Leadtools.Forms;
using Leadtools.Codecs;


namespace testtm
{
       
        public partial class MainForm : Form
        {
                public MainForm()
                {
                        //
                        // The InitializeComponent() call is required for Windows Forms designer support.
                        //
                        InitializeComponent();
                       
                        //
                        // TODO: Add constructor code after the InitializeComponent() call.
                        //
                }
               
                 private RasterCodecs _Codefile = new RasterCodecs();
                 
        void Button1Click(object sender, EventArgs e)
                {
       
            RasterImage image = imageViewer1.Image;
            BarcodeEngine engine = new BarcodeEngine();

            BarcodeData data = new BarcodeData();
            data.Symbology = BarcodeSymbology.UPCA;
            data.Value = "01234567890";
            data.Bounds = new LogicalRectangle(10, 10, 600, 200, LogicalUnit.Pixel);
            
            OneDBarcodeWriteOptions options = new OneDBarcodeWriteOptions();
            options.EnableErrorCheck = true;     
         
            engine.Writer.WriteBarcode(image, data, options);

        }               
     
                void Button2Click(object sender, EventArgs e)
                {
                        string filepath=@"d:\123.tif";
                         imageViewer1.Image = _Codefile.Load(filepath, 1, CodecsLoadByteOrder.BgrOrGray, 1, 1);
                         
      
                }
                void MainFormLoad(object sender, EventArgs e)
                {
                  unlock();
                }
        }


以上就是全部代码
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-12-20 18:39:43
6#
好的,研究一下,尽快给你答复
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-12-21 16:31:39
7#
沙尘暴 发表于 2016-12-20 15:53
using System;
using System.Collections.Generic;
using System.Drawing;

你好,将你的源码Button1Click,Button2Click部分都加入进行测试是没有问题的,可以确保在载入tif文件后进行写操作是不会报错,考虑是否是引用的leadtools dll缺少
请参考原demo引用
using Leadtools.Demos;
using Leadtools.Demos.Dialogs;
using Leadtools;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.Codecs;
using Leadtools.WinForms;
using Leadtools.Twain;
using Leadtools.Forms;
using Leadtools.Barcode;
using System.Drawing.Drawing2D;
using Leadtools.Controls;

或者将你的源码整体打包作为附件发上来
回复 使用道具 举报
沙尘暴
初级会员   /  发表于:2016-12-22 15:02:57
8#
附件,谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-12-22 17:43:44
9#
好的,尽快给你结果
回复 使用道具 举报
沙尘暴
初级会员   /  发表于:2016-12-29 08:19:46
10#
??? 还没有结果吗
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部