找回密码
 加入
搜索
楼主: userlong

[系统综合] 打印控件vsPrint8.ocx。如何插入图片 请高手指点一下

 火.. [复制链接]
发表于 2016-6-2 15:58:27 | 显示全部楼层
回复 15# userlong

.DrawPicture(.LoadPicture("C:\名5.jpg"),3000,10000, "10cm", "10cm", "500%", "500%")
 楼主| 发表于 2016-6-2 16:07:52 | 显示全部楼层
果然厉害。我看了你的资料 就是没有loadpicture.....汗颜
 楼主| 发表于 2016-6-2 16:09:42 | 显示全部楼层
所以还是给这种有用点
发表于 2016-6-2 16:11:15 | 显示全部楼层
回复 17# userlong

老實說  這個不好用
太繁瑣  無法設計 複雜報表

目前 我覺得銳浪的 最好用 也適合AU3 用
 楼主| 发表于 2016-6-2 16:32:44 | 显示全部楼层
銳浪?什么东西
 楼主| 发表于 2016-6-2 16:33:48 | 显示全部楼层
回复 19# kk_lee69


    锐浪  我没有详细的使用 和例子啊  你能给些吗?
 楼主| 发表于 2016-6-2 16:36:05 | 显示全部楼层
回复 19# kk_lee69


    .DrawPicture(.LoadPicture("123.bmp"),3000,10000, "4cm", "4cm", "100%", "100%")
这个一样要给详细路径吗?不能在同目录下直接认到吗?
发表于 2016-6-2 16:37:51 | 显示全部楼层
 楼主| 发表于 2016-6-2 16:39:03 | 显示全部楼层
你给的这个没没有权限进入查看
发表于 2016-6-2 16:43:50 | 显示全部楼层
回复 22# userlong

同目錄 不就是 @ScriptDir+"\檔案"
 楼主| 发表于 2016-6-3 10:53:59 | 显示全部楼层
回复 25# kk_lee69
高手帮我看看这个为什么。我按钮点提交  打印预览界面出现了。但是只要在打印预览双击 拖动。然后主窗体就死掉了?
主窗体:

    #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "_pp.au3"
$cgspb_1 = GUICreate("单据", 1267, 713, 279, 130)



     
$cgyj_Button1 = GUICtrlCreateButton("提交", 112, 288, 75, 25)
  GUICtrlSetOnEvent($cgyj_Button1, "kc")
      
GUISetState(@SW_SHOW)


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                        Case $GUI_EVENT_CLOSE
                Exit
                        Case $cgyj_Button1
                                kc()

        EndSwitch
WEnd
        
--------------------------------------------------------------------------------------------------------
打印窗体
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Func kc()
       
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("打印预览", 601, 701)
$op = ObjCreate("VSPrinter8.VSPrinter.1")
$oh = GUICtrlCreateObj($op, 0, 0, 600, 700)
GUISetState(@SW_SHOW,$Form1)
With $op
       ; .preview = True;打印预览
        .DocName = "打印"
        .MarginLeft = 1000;左边距
        .MarginRight = 1000;右边距
        .MarginTop = 1000;上边距
        .MarginBottom = 1000;下边距
        .PaperSize = 9;页面大小 A4
        .Orientation = 0;页面方向。横向,纵向

        .StartDoc;页面开始
        .SpaceAfter = 400;段落间距
        .TextAlign = 0;文字对齐 0:靠左;1:居中;2:靠右
        .FontName = "黑体";字体
        .FontBold = True;字体加粗
        .FontSize = 30;字号
        .Paragraph = "标题";文字
        .FontSize = 16
        .Paragraph = "是好似好似好似hi实施时候死时候好似hi时尚" & _
                        "减肥的理解的是离开房间时看到附件里看的是解放路口的时间弗兰克"
        .Paragraph = "Right now the margins are set as follows:"

        .SpaceAfter = 0;段落间距
        .AddTable("3000|1000", "项目|值", _
                        "左边距|" & Int(.MarginLeft) & ";" & _
                        "上边距|" & Int(.MarginTop) & ";" & _
                        "右边距|" & Int(.MarginRight) & ";" & _
                        "下边距|" & Int(.MarginBottom) & ";", 0xffffff)
        .AddTable("3000|1000|1000", "项目|值", _
                        "左边距|" & Int(.MarginLeft) & ";" & _
                        "上边距|" & Int(.MarginTop) & ";" & _
                        "右边距|" & Int(.MarginRight) & ";" & _
                        "下边距|" & Int(.MarginBottom) & ";", 0xffffff)


    .PenColor = 0x000000;画笔颜色,黑色
        .BrushColor = 0xffffff;刷子颜色,白色
        .PenStyle = 6
        .PenWidth = 10;画笔宽度
        
        .DrawLine(4000, 0, 4000, 17000);划线
        .DrawLine(8000, 0, 8000, 18000);划线
        .DrawLine(0, 4250, 12000, 4250);划线        
        .DrawLine(0, 8500, 12000, 8500);划线        
        .DrawLine(0, 12750, 12000, 12750);划线               

        .DrawCircle(3000,3000,200);画圆
        .FontSize = 12
        .Paragraph = "单位: 元"
        

        .EndDoc;页面结束


EndWith


EndFunc
发表于 2016-6-3 11:54:23 | 显示全部楼层
回复 26# userlong


#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

DIM $Form1

$cgspb_1 = GUICreate("单据", 1267, 713, 279, 130)




$cgyj_Button1 = GUICtrlCreateButton("提交", 112, 288, 75, 25)
  GUICtrlSetOnEvent($cgyj_Button1, "kc")

GUISetState(@SW_SHOW)


While 1
        $nMsg = GUIGetMsg(1)
        Switch $nMsg[0]
                        Case $GUI_EVENT_CLOSE
                                                IF $nMsg[1]=$Form1 THEN
                                                   GUIDelete($Form1)
                                                Else
                                                   EXIT
                                                EndIf

                        Case $cgyj_Button1
                                kc()

        EndSwitch
WEnd


Func kc()

#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("打印预览", 601, 701)
$op = ObjCreate("VSPrinter8.VSPrinter.1")
$oh = GUICtrlCreateObj($op, 0, 0, 600, 700)
GUISetState(@SW_SHOW,$Form1)
With $op
       ; .preview = True;打印预览
        .DocName = "打印"
        .MarginLeft = 1000;左边距
        .MarginRight = 1000;右边距
        .MarginTop = 1000;上边距
        .MarginBottom = 1000;下边距
        .PaperSize = 9;页面大小 A4
        .Orientation = 0;页面方向。横向,纵向

        .StartDoc;页面开始
        .SpaceAfter = 400;段落间距
        .TextAlign = 0;文字对齐 0:靠左;1:居中;2:靠右
        .FontName = "黑体";字体
        .FontBold = True;字体加粗
        .FontSize = 30;字号
        .Paragraph = "标题";文字
        .FontSize = 16
        .Paragraph = "是好似好似好似hi实施时候死时候好似hi时尚" & _
                        "减肥的理解的是离开房间时看到附件里看的是解放路口的时间弗兰克"
        .Paragraph = "Right now the margins are set as follows:"

        .SpaceAfter = 0;段落间距
        .AddTable("3000|1000", "项目|值", _
                        "左边距|" & Int(.MarginLeft) & ";" & _
                        "上边距|" & Int(.MarginTop) & ";" & _
                        "右边距|" & Int(.MarginRight) & ";" & _
                        "下边距|" & Int(.MarginBottom) & ";", 0xffffff)
        .AddTable("3000|1000|1000", "项目|值", _
                        "左边距|" & Int(.MarginLeft) & ";" & _
                        "上边距|" & Int(.MarginTop) & ";" & _
                        "右边距|" & Int(.MarginRight) & ";" & _
                        "下边距|" & Int(.MarginBottom) & ";", 0xffffff)


    .PenColor = 0x000000;画笔颜色,黑色
        .BrushColor = 0xffffff;刷子颜色,白色
        .PenStyle = 6
        .PenWidth = 10;画笔宽度

        .DrawLine(4000, 0, 4000, 17000);划线
        .DrawLine(8000, 0, 8000, 18000);划线
        .DrawLine(0, 4250, 12000, 4250);划线
        .DrawLine(0, 8500, 12000, 8500);划线
        .DrawLine(0, 12750, 12000, 12750);划线

        .DrawCircle(3000,3000,200);画圆
        .FontSize = 12
        .Paragraph = "单位: 元"


        .EndDoc;页面结束


EndWith


EndFunc
 楼主| 发表于 2016-6-3 12:29:37 | 显示全部楼层
本帖最后由 userlong 于 2016-6-3 12:30 编辑

回复 27# kk_lee69


    按照你这个   $cgspb_1 = GUICreate("单据", 1267, 713, 279, 130)
这个窗体还是会死掉。。。而且我发现 还是关闭  打印那个窗口之后  主窗体才死掉
发表于 2016-6-3 13:01:18 | 显示全部楼层
回复 28# userlong


    哪裡死掉  每個按鈕都有作用
发表于 2016-6-3 15:20:44 | 显示全部楼层
回复 29# kk_lee69
请问这个打印浏览控件能有什么作用???
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-2 23:14 , Processed in 0.076943 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表