Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    187
    Rep Power
    82
    Originally Posted by chocolade
    In C file code on top I did:

    Code:
    wchar_t *filename;
    Then inside the GetFrameData function I did:

    Code:
    Gdiplus::Bitmap *bitmap = new Gdiplus::Bitmap ( filename );
    Then i'm using a header file to pass the filename variable globaly:

    Code:
    wchar_t filename;
    Then in the header file on the c++ i'm doing:

    Code:
    void Push( Bitmap ^b )
    	{
    		filename = b;
                  }
    Ofcourse the filename is type wchar_t and the b is Bitmap so i'm getting an error I didn't except it to work so how can I fix it ?
    Well, first of all, I've never mixed and matched code like this. But the obvious answer is you can't assign a bitmap property to a string property. Also the bitmap property does NOT keep track of the file name. The obvious solution is to also pass the filename to the method in your parm list.
  2. #17
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    11
    Rep Power
    0

    Bob how do i get the bitmap file name ?


    In Csharp i'm using a stream in memory I don't save the bitmaps to the hard disk.

    This is in Csharp:

    Code:
    namespace ScreenVideoRecorder
    {
        class AviFile
        {
            AviManager aviManager;
    
            Bitmap bmp;
            int count = 0;
            VideoStream aviStream;
    
            public AviFile()
            {
                aviManager = new AviManager(@"d:\testdata\new.avi", false);
            }
    
            public void CreateAvi(ScreenCapture sc)
            {
                bmp = new Bitmap(sc.CaptureScreen());
                count++;
                    if (count == 1)
                    {
                     aviStream = aviManager.AddVideoStream(true, 25, bmp);//dlg.Rate, bmp);
                    }
                //aviStream.AddFrame(bmp);
                //bmp.Dispose();
            }
    
            public AviManager avim
            {
                get
                {
                    return aviManager;
                }
                set
                {
                    aviManager = value;
                }
            }
        }
    }
    Then I send the bitmap get it in the c++ in the Push function as Bitmap. And in the C file the global variable fname is WCHAR .

    So what should I do in the C function and what to do in the c++ Push function to get the name of the file if it's in memory ?

    My program in Csharp create screenshots each 30ms and I capture it and add it to an avi file the avi file is on the hard disk but the Bitmaps are in memory.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo