如何打印数据库中的图片(以相对路径+文件名存储)?请各位详细一点!谢谢大家!!!

解决方案 »

  1.   

    1。 你用的打印tools是什么控件
    2。他是否支持打印图片
    3。 以相对路径+文件名存储?
       是通过服务器打印本地打?这是必要条件阿!
      

  2.   

    先读出来
    再用Printer.PaintPicture()函数打印
      

  3.   

    string b_npc_name = "店员";
    string b_npc_city = "比奇县";
    int    b_npc_x = 463, b_npc_y = 427;array  fs_books = ({ "大火球", "雷电术",   "击风",   "冰月震天",
                        "地狱火", "疾光电影", "风震天", "冰沙掌" ,"火墙","诱惑之光","抗拒火环"});array  ds_books = ({ "隐身术", "召唤骷髅",   "月魂灵波",   "治愈术",
                        "幽灵盾", "困魔咒", "集体隐身术",  });// 鉴定者的名字,对话坐标
    string i_npc_name = "华龙断珠";
    string i_npc_name2 = "比奇道长";
    int    i_npc_city = "比奇县";
    int    i_npc_x = 463, i_npc_y = 427; // 对话华龙断珠位置
    int    i_npc_x2 = 457, i_npc_y2 = 431; // 同时对话华龙断珠、比奇道长位置(如果想销售道士书籍有必要用这个坐标)void start()
    {
        mapping mc;
        string  book_name;
            string  book_name2;
        int     total;
            int     total2;
        //int     count;
        int     i;    // 首先设定所有的秘籍可卖,不优先,以免鉴定后无法出售
        for (i = 0; i < sizeof(fs_books); i++)
        {
            all_item_list[fs_books[i] + "(秘籍)"]["storage"] = 0;
            all_item_list[fs_books[i] + "(秘籍)"]["manage"]  = 1;
        }
                for (i = 0; i < sizeof(ds_books); i++)
        {
            all_item_list[ds_books[i] + "(秘籍)"]["storage"] = 0;
            all_item_list[ds_books[i] + "(秘籍)"]["manage"]  = 1;
        }    printf("开始自动鉴定书籍。\n");
        for (;;)
        {
            book_name = fs_books[0];
                    book_name2 = ds_books[0];
            total = 0;
                    total2 = 0;        mc = me()["carry"];
            for (i = sizeof(mc) - 1; i >= 0; i--)
                if (mc[i]["name"] == book_name)
                    total++;                        if (mc[i]["name"] == book_name2)
                    total2++;        if (total > 0)
                // 现在有还没有鉴定的书籍,直接前往鉴定
                goto start_identify;        // 跑到书商处
            printf("前往销售、购买书籍。\n");
            goto_city_ex(b_npc_city, b_npc_x, b_npc_y, 10);
        
            // 快速销售现有书籍
            sell_item(({ ITEM_BOOK }), b_npc_name, 0, 1);start_identify:;
            // 购买完毕,前往鉴定
            printf("前往鉴定书籍。\n");
            goto_city_ex(i_npc_city, i_npc_x, i_npc_y, 10);                        while (total-- > 0)
            {
                talk_to(i_npc_name);
                talk_to(i_npc_name, "查看");
                talk_to(i_npc_name, book_name);
                talk_to(i_npc_name, "学武功");
            }
        
            // 鉴定完毕,继续销售、购买                if (total2 > 0)
                // 现在有还没有鉴定的书籍,直接前往鉴定
                goto start_identify2;
        
    start_identify2:;
            // 购买完毕,前往鉴定
            printf("前往鉴定书籍。\n");
            goto_city_ex(i_npc_city, i_npc_x2, i_npc_y2, 10);
        }        while (total2-- > 0)
            {
                talk_to(i_npc_name2);
                talk_to(i_npc_name2, "查看");
                talk_to(i_npc_name2, book_name);
                talk_to(i_npc_name2, "学武功");
            }
    }// 启动时自动开始买书鉴定
    if((me()["carry"])==680) //680是自身负重,玩家可以按照自身能力调改
    {
    create_thread(QUEST_THREAD, "start");
    }
    // 卸载时停止
    private void destruct()
    {
        printf("停止。\n");
        delete_thread(QUEST_THREAD);
    }
      

  4.   

    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongShellExecute Me.hwnd, "print", "C:\aa.bmo", vbNullString, vbNullString, 1
    将你数据库中的路径名给此函数就行了!!
      

  5.   

    将图片框命名 PICPrivate Sub ActiveReport_FetchData(eof As Boolean)  FileName=ME.Fields("FileName").Value
      Dim OB_PIC As Object
      Set OB_PIC = LoadPicture(FileName)
      SET PIC.Picture=OB_PIC 
    END SUB
      

  6.   

    建议用paintpicture打印,shellexecute达不到打印效果(xp系统,调出了图片查看器,没有打印)
      

  7.   

    如果图片不是在本地就要用FPT先下在(启动打印前)