Hi can anyone help me. Currently im using Luxand and c#.

I want to save my 2nd image using different name. But How can anyone help me?

Heres my codes:

public partial class Form1 : Form
   {
string Filelocation = @"D:\Facial Based Tracker Device\Images\Viewer.jpg";
.
.
.
.
FSDK.CreateEmptyImage(ref fr.FaceImageHandle);
                          FSDK.DetectFacialFeaturesInRegion(fr.ImageHandle, ref fr.FacePosition, fr.FacialFeatures);
                          FSDK.GetFaceTemplateUsingFeatures(fr.ImageHandle, fr.FacialFeatures, fr.Template);
                          FSDK.CopyRect(fr.ImageHandle, (int)(fr.FacePosition.xc - Math.Round(fr.FacePosition.w * 0.5)), (int)(fr.FacePosition.yc - Math.Round(fr.FacePosition.w * 0.5)), (int)(fr.FacePosition.xc + Math.Round(fr.FacePosition.w * 0.5)), (int)(fr.FacePosition.yc + Math.Round(fr.FacePosition.w * 0.5)), fr.FaceImageHandle);
                          FSDK.SaveImageToHBitmap(fr.FaceImageHandle, ref fr.FaceImageBmp);
FSDK.SaveImageToFile(fr.FaceImageHandle, Filelocation);

}

Recommended Answers

All 4 Replies

On line 14 (from the code in your post) add:

File.Copy(Filelocation, @"C:\path\to\new\image.jpg");

Hmm i mean i need to save View.jpg to different name in View1.jpg .... View2.jpg

On line 14 (from the code in your post) add:

File.Copy(Filelocation, @"C:\path\to\new\image.jpg");

I want to save different FileName each time ... is like image1.jpg....image2.jpg etc.

Is this what you mean?

using System.IO;
...

    private void button4_Click(object sender, EventArgs e)
    {
      string Filelocation = @"D:\Facial Based Tracker Device\Images\Viewer.jpg";
      string dir = Path.GetDirectoryName(Filelocation);
      string ext = Path.GetExtension(Filelocation);
      string nam = Path.GetFileNameWithoutExtension(Filelocation);
      for (int i1 = 1; i1 < 10; i1++)
      {
        string outFile = Path.ChangeExtension(Path.Combine(dir, nam+i1.ToString()), ext);
        Console.WriteLine(outFile);
      }
    }

Results in:

D:\Facial Based Tracker Device\Images\Viewer1.jpg
D:\Facial Based Tracker Device\Images\Viewer2.jpg
D:\Facial Based Tracker Device\Images\Viewer3.jpg
D:\Facial Based Tracker Device\Images\Viewer4.jpg
D:\Facial Based Tracker Device\Images\Viewer5.jpg
D:\Facial Based Tracker Device\Images\Viewer6.jpg
D:\Facial Based Tracker Device\Images\Viewer7.jpg
D:\Facial Based Tracker Device\Images\Viewer8.jpg
D:\Facial Based Tracker Device\Images\Viewer9.jpg
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.