Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Code Question...
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
daniel.masse@capture-action.ca
Posted: Feb 12 2003, 08:43 PM


Unregistered









Hi,

I need to create a button that capture automatically a picture (BMP) of the current frame to a specific folder...

I have created a button that call the function "SaveImageSeq". I have changed that function. I want to capture only 1 picture. So, I have to set the selection start to the current frame and the selection end to the following frame. (I need 2 frames to create a picture).

I am able to set the selection start with the function :
SendMessage(hwnd, WM_COMMAND, ID_EDIT_SETSELSTART, 0);

But I don't know how to set the selection end to the next frame...

Does somebody know how to selection the next frame by programmation?

Thanks...



==================================================

void SaveImageSeq(HWND hwnd) {
SaveImageSeqDlgData sisdd;

if (!inputVideoAVI) {
MessageBox(hwnd, "No input video stream to process.", g_szError, MB_OK);
return;
}

memset(&sisdd, 0, sizeof sisdd);

strcpy(sisdd.szDirectory,"C:\TEST");
//strcpy(sisdd.szFormat,sisdd.szDirectory);
sisdd.digits = 3;
strcpy(sisdd.szPrefix,"dcs");
sisdd.bSaveAsTGA = false;
strcpy(sisdd.szPostfix,".bmp");

// Set the selection start...
SendMessage(hwnd, WM_COMMAND, ID_EDIT_SETSELSTART, 0);

// Now I need to select the next frame as the selection end...
// I don't know how to do it!!!!!!!!!!!!!!!!
//SendMessage(hwnd, WM_COMMAND, ID_EDIT_SETSELEND, 0);

sisdd.lFirstFrame = inputVideoAVI->lSampleFirst;
sisdd.lLastFrame = inputVideoAVI->lSampleLast-1;

sisdd.bRunAsJob = false;

// if (DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_AVIOUTPUTIMAGES_FORMAT), hwnd, SaveImageSeqDlgProc, (LPARAM)&sisdd)) {
SetAudioSource();

try {
if (sisdd.bRunAsJob)
JobAddConfigurationImages(&g_dubOpts, g_szInputAVIFile, FILETYPE_AUTODETECT, sisdd.szPrefix, sisdd.szPostfix, sisdd.digits, sisdd.bSaveAsTGA, &inputAVI->listFiles);
else
SaveImageSequence(sisdd.szPrefix, sisdd.szPostfix, sisdd.digits, false, NULL, sisdd.bSaveAsTGA);
} catch(const MyError& e) {
e.post(NULL, g_szError);
}
// }
}

==================================================

 
  Top
phaeron
Posted: Feb 13 2003, 03:54 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Use the clip list instead of the output range.

if (inputSubset)
delete inputSubset;

inputSubset = new FrameSubset;
inputSubset->addRange(nFrame, 1, false);
 
    Top
daniel.masse@capture-action.ca
Posted: Feb 13 2003, 10:06 PM


Unregistered









Thanks a lot!

Just a more thing...

The image is not save in the folder "C:\TEST" even if I do:

strcpy(sisdd.szDirectory,"C:\\TEST");

(the folder already exist)


We will give you some money for your help because it's very appreciated...
 
  Top
phaeron
Posted: Feb 14 2003, 04:14 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



That looks suspiciously like a regression I introduced in 1.4.11 and fixed in 1.4.12. The call to SaveImageSequence() is supposed to pass szFormat as the first parameter instead of szPrefix. However, szFormat is computed in the dialog code from szDirectory and szPrefix. So you might as well just pass the desired path directly instead of using the "sisdd" structure as an obfuscated set of local variables (the only reason it exists is for data exchange with the dialog).
 
    Top
daniel.masse@capture-action.ca
Posted: Feb 14 2003, 03:17 PM


Unregistered









thanks, you're the best!! ;o)
 
  Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
4 replies since Feb 12 2003, 08:43 PM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Development Forum