liwanyi2012
liwanyi2012
2016-03-08 12:58

c#我这样写代码后,为什么运行后窗体不显示picturebox中的图片,要怎样才能显示

  • c#
  • namespace
  • 编程语言
  • class

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _1340226147
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }
    private void AddPictureBox(int left, int top)
    {

    }

    private void axBarCodeCtrl1_Enter(object sender, EventArgs e)
    {
        axBarCodeCtrl1.Value = "1340226147";
    }

    private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
    {
        Graphics g = e.Graphics;
        Bitmap bb = BarCodeTest.ControlBitmap.getControlBitmap(axBarCodeCtrl1);
        g.DrawString("***", new Font("宋体", 30, FontStyle.Bold), new SolidBrush(Color.Black), 10, 10);
        g.DrawImage(bb, 10, 100);
        //Bitmap ab = 
    }

    private void button1_Click(object sender, EventArgs e)
    {
        printDocument1.Print();
    }

    private void Form1_Paint(object sender, PaintEventArgs e)
    {

    }

}

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答