如果在DCL上显示二维码,如果不需要显示二维码中的图片,可以试试这个..使用方式,输入文本生成list表
复制list表替换lisp中的表
命令tt测试DCL显示的效果.
优点,存储的数据很小.因为只是保存的二维码的数据,也可以使用这个编码的表来生成CAD中的图形,
程序是C++MFC编译的Win32程序,应该大多数win系统可以直接运行
缺点,对于lisp来说,如果需要动态生成,这个就不实用了.
如果你只有二维码图片,可以使用在线的二维码识别网站识别出来,然后复制解码后的文本,再使用这个生成lisp表.
附件为exe程序
下面是测试的lisp代码,简单测试
- (defun c:tt(/ file f dcl_id)
- (setq file (vl-filename-mktemp "myapp.dcl"))
- (setq f(open file "w"))
- (write-line "mydlg:dialog {" f)
- (write-line " :image {" f)
- (write-line " height = 15 ;" f)
- (write-line " key = \"img\" ;" f)
- (write-line " width = 30 ;" f)
- (write-line " }" f)
- (write-line " ok_only;" f)
- (write-line "}" f)
- (close f)
-
- (setq dcl_id(load_dialog file))
- (print dcl_id)
- (vl-file-delete file)
- (setq lst(list
- (list 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 0 1 0 0 0 0 1 0 1 1 1 1 1 1 1)
- (list 1 0 0 0 0 0 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 1 0 1 0 1 0 0 0 0 0 1)
- (list 1 0 1 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0 1)
- (list 1 0 1 1 1 0 1 0 0 1 0 0 1 1 1 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 1 1 0 1)
- (list 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1)
- (list 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1)
- (list 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 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1 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0)
- (list 1 0 1 1 1 0 1 0 1 1 0 0 0 1 0 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 1 1 1 1)
- (list 1 0 1 1 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 0 0 1 1 0)
- (list 1 0 0 0 0 0 1 0 0 0 1 1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 1 1 1 1 1 0 0)
- (list 1 1 1 1 1 1 1 0 0 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1)
- )
- )
- (new_dialog "mydlg" dcl_id)
- (setq w(dimx_tile "img"))
- (setq h(dimy_tile "img"))
- (start_image "img")
- (fill_image 0 0 w h -15)
- (setq num (length(car lst)))
- (setq sw(fix(/ w num)))
- (setq j -1)
- (foreach k lst
- (setq j(1+ j))
- (setq i -1)
- (foreach n k
- (setq i(1+ i))
- (if (= n 1)(fill_image (* i sw) (* j sw) sw sw 0))
- )
- )
- (end_image)
- (start_dialog)
- )
|