-3

Hi I'm writing an application using c# and I want to load one image and write some information in it.

There is a variable in my program named cnt where indicates numbers of images I should show .It means if cnt==2 I should load image and put two different information in it.

Note : The image is a raw template for a certificate and I should load and show them based on some information of different certificates.

So how can I do it? Can PictureBox help me? How can I enable paging in it?

EDIT:

After reading from excel and get a match increase cnt:

foreach (DataRow drow in ds.Tables[0].Rows)
{
    DataRow dataRow = (from DataRow dr in ds.Tables[0].Rows where dr["شماره کارت ملی"].ToString() == textBox1.Text select dr).FirstOrDefault();

    cnt++;
    string s = "" ,s1="",s2="",s3="";
    if (dataRow[0].ToString().Length < 17)
    {
        fname1 = Encoding.Default.GetBytes("write1" + dataRow[0].ToString() + s.PadLeft(16 - dataRow[0].ToString().Length, '.'));
        comport.Write(fname1,0,fname1.Length);
        System.Threading.Thread.Sleep(1000);
        fname2 = Encoding.Default.GetBytes("write4"  + s.PadLeft(14, '#') + dataRow[2].ToString().Substring(0, 2));
        comport.Write(fname2, 0, fname2.Length);
    }
    //do some other stuff

I want to show draw different information of a certificate on a certificate image template. If cnt is two the person has two certificates for two skill so the image template is the same but the skill information is different.

Rémi
  • 3,867
  • 5
  • 28
  • 44
user2628363
  • 143
  • 1
  • 3
  • 14
  • I presume this is a WinForms application? Could you provide some sample code from where you're instantiating and using `cnt` in your form? As it stands this question is pretty broad and hard to answer. – Jim Dagg Aug 05 '13 at 17:55
  • I edited and put some snipped code. The code is too long so I just put the `cnt` increasing part . – user2628363 Aug 05 '13 at 18:51

1 Answers1

1

Sure I can help you.

  1. Draw an Image Directly to the form (C# .NET) http://www.youtube.com/watch?v=lt8Lk4LlTPA

  2. How to draw a line on a image in C#? how to draw a line on a image?

  3. How to draw text on bitmap in C#? c# write text on bitmap

Community
  • 1
  • 1
NoWar
  • 36,338
  • 80
  • 323
  • 498