0

I am using Flexcode sdk. I don't know how to save the images location (imgpath as in the code) as bitmap. Once save, i wishes to assign it to the picturebox. Can i know how can i save the image path location to bitmap and then assigns it(bitmap) to picturebox.

    private void FormAttendance_Load(object sender, EventArgs e)
    {
        verStudentFingerprint.PictureSampleHeight = (short)(pictureBoxAttendanceVerification.Height * 15); //FlexCodeSDK use Twips. 1 pixel = 15 twips
        verStudentFingerprint.PictureSampleWidth = (short)(pictureBoxAttendanceVerification.Width * 15); //FlexCodeSDK use Twips. 1 pixel = 15 twips
        imgPath = AppDomain.CurrentDomain.BaseDirectory + "Finger3.bmp";
        verStudentFingerprint.PictureSamplePath = imgPath;
    }


    void ver_FPVerificationImage()
    {
        pictureBoxAttendanceVerification.Load(imgPath);
        if (imgPath == AppDomain.CurrentDomain.BaseDirectory + "Finger3.bmp")
        {
            imgPath = AppDomain.CurrentDomain.BaseDirectory + "Finger5.bmp";
        }
        else
        {
            imgPath = AppDomain.CurrentDomain.BaseDirectory + "Finger3.bmp";
        }
        verStudentFingerprint.PictureSamplePath = imgPath;
    }
Programmer
  • 39
  • 7
  • Hard to tell what is your problem, but please use `Path.Combine()` when generating file name. – Sinatr Apr 25 '16 at 13:59
  • thanks for the reply, this means instead of AppDomain.CurrentDomain.BaseDirectory i use path.combine()? it basically oad image into picture box into the pictureboxattendanceverification but instead of loading i want it to save to a bitmap and the load to pictureboxattendanceverification so that later i can jus dispose the bitmap instead of the picturebox itself – Programmer Apr 25 '16 at 14:03
  • Start with describing your problem clearly: use "I don't know how ... " (*how* should be the *smallest* thing, not broad ".. save bitmap of fingerprint", but e.g. ".. generate file name properly") or "I get error ..." (include error in question, you can [edit](http://stackoverflow.com/posts/36842609/edit) it). – Sinatr Apr 25 '16 at 14:06
  • sir i edit my question – Programmer Apr 25 '16 at 14:13
  • It's still unclear what problem you have, perhaps [saving `PictureBox` bitmap](http://stackoverflow.com/q/2880840/1997232) ? – Sinatr Apr 25 '16 at 14:20
  • means like what in this statement pictureBoxAttendanceVerification.Load(imgPath) it loads the imagepath directly to tjhe picturebox, but what i wish to do is instead of loading the imagepath directly to picture box i wish to save it to bitmap nd then assign to picturbox. The reasons is to allow later bitmap.dispose instead of disposing the picturebox – Programmer Apr 25 '16 at 14:23
  • Did I say the problem is not clear? ;) It sounds like you simply want to load [image from file](https://msdn.microsoft.com/en-us/library/stf701f5(v=vs.110).aspx), then this image can be directly assigned as [`PictureBox.Image`](https://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.image(v=vs.110).aspx). – Sinatr Apr 25 '16 at 14:46
  • i already load the image only need assign to bitmap and then bitmap assign to picturebox to allow bitmap.dispose – Programmer Apr 25 '16 at 15:05

0 Answers0