|
Dear all,
I am having some problem to use the AVICap macros provided by Windows. I am writing an application to constantly (say 1 second) grab an image from the web camera and save it as an bitmap file. I used capFileSaveDIB() to save the image captured into the bitmap file. The program works fine when it is the active window (running at the foreground). If the application is minimized, or covered by another application, which means the preview window is invisible, then, capFileSaveDIB() will not save the current image to the file.
Can anybody help me on this? Should I use capFileSaveDIB() for this? Or any setting that I have forgotten?
Thanks
Yong Haur
|
|
|
|
|
it is the major disadvantage of avicap class.it doesn't work in invisible mode.read article by vadim in multimedia/video section of code guru.try use his class it is slow but works fine
bye
bobbies_2001@yahoo.com
bobby
|
|
|
|
|
How I can place FileDialog in a view?
I don't want the fileDialog to pop-up when a button is pressed , I want the filedialog on the view when the view is opened.
|
|
|
|
|
The short answer is form view, but t could get ugly - some common dialogs do not function unless called modally.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I seem to recall seeing an MS KB article about embedding common dialogs in other windows (eg, property sheets) and the jist of the article was that it can't be done because the dialogs expect to be modal. Search the KB - the article shouldn't be too tough to find.
--Mike--
http://home.inreach.com/mdunn/
I'm finger-lickin' good!
|
|
|
|
|
In a program i'm currently working on, i want to be able to zoom in bitmaps. I've created a memory dc containing the bitmap and every time the user clicks the zoom button this dc is stretch bitblitted in another memorydc called zoomdc. ZoomedPictureDC is written to the screen in ondraw(). This way I don't have to enlarge the picture every draw, saves a lot of speed. The following code is in the zoom function. ZoomedPictureDC is a member variable of the View.
ZoomedPictureDC.StretchBlt(0,0,pDoc->bmPicture.bmWidth * zoomlevel, pDoc->bmPicture.bmHeight * zoomlevel, &PictureDC,0,0,pDoc->bmPicture.bmWidth, pDoc->bmPicture.bmHeight,SRCCOPY);
Why doesn't this work? I tried stretchblitting the picture every time in ondraw, this does work but is terribly slow.
wavk
|
|
|
|
|
have you obtained a device contect to the window in your drawing function?
can't see one from the snippet you posted
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
When you say does not work, what does it do ? If nothimg, have you created the DC in question and selected a bitmap of suitable size into it ? If a and not b, you have a 1x1x1 bitmap space to work with. Does it look funny ? You may have forgotten to SetStretchBltMode ( to HALFTONE or COLORONCOLOR ). Did you do all this and nothing happened still ? There is a known bug in StretchBlt, where it returns 0 when it fails. When you use StretchBlt you should always check for a 0 return and deal with potential failure. My experience is it fails after a 16 x zoom, so I doubt that is the problem here.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Type Mémo in MDB->0 to 65535 char and with CRecordSet insertion Failed with CString > 255 char
Please, Help.
|
|
|
|
|
I am unable to use string variable
I have:
#include <string>
but still when I write :
string filename;
I get error that :
missing ; before indentifier filename
Also I am unable to use vector
despite that fact that I have
#include <vector>
I am using Visual C++ 6.0
Please help me !!!!!!!!!!!!!!!!!!!1
|
|
|
|
|
Are you trying to use STL string? Probably you should add:
using namespace std;
after the #include
|
|
|
|
|
I have
#include < string >
using namespace std;
......................
............................
string filename;
cin>>filename;
I get following error :
: error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' (or there is no acceptab
le conversion)
Why ???
|
|
|
|
|
you have not included <iostream>
|
|
|
|
|
I have
#include < string >
using namespace std;
......................
............................
string filename;
cin>>filename;
I get following error :
: error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' (or there is no acceptab
le conversion)
Why ???
|
|
|
|
|
During the process of building a namespace extension in C++, we stumbled on a couple of problems.
Our namespace extension must be able to have different views: e.g. the Large Icons, Small Icons, List and the Detail View.
In the meantime, you will notice that there is a ToolBar embedded in the explorer menus where one can change the View of the “folders” in the List View of the explorer. However, it seems virtually impossible to catch the message or get a notification of a user CLICK in this toolbar. This ToolBar is a visual duplication of some of the explorer view menu items. However I do get a WM_MENUSELECT message with ID 28713/28714/28715/28716 when sliding over the menus without selecting or CLICKING them!!
Again, we do not seem to get any notification through the IShellView or the IOleCommandTarget interface or any other interface of a change in (the user’s) view selection. I already investigated the messages flying around in explorer by using the Spy++ tool and I noticed that explorer uses a lot of WM_USER + N messages but none that I recognize.
Van anyone shed some light on the subject? Is it possible to catch the view menu selections (= MOUSE CLICK) ? Does anyone have a sample, which implements different folder views for a namespace extension?
Thank you and best regards,
Gert.
--------------------------------------------------
If my messages appear curt, I apologize.
I try to be brief to save your time as well as mine.
--------------------------------------------------
|
|
|
|
|
We are getting an error an error while buliding C++ exe. The error is as follows
error LNK2001: unresolved external symbol "struct fpos_t const std::_Fpz" (?_Fpz@std@@3Ufpos_t@@B).
Any Solutions for this errors are very much welcomed
Raja Sekhar
|
|
|
|
|
Linker errors generally mean you have forgotten to include a class in your project, or the path to a needed lib is missing.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi,
I'd like to know how in an MFC based sound application we can capture the MM_MCINOTIFY messages that get sent by calls to mciSendCommand(...) with the MCI_NOTIFY flag passed to it already?
I know that in an SDK app, it is captured inside the Window Procedure function like this:
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case MM_MCINOTIFY:
break;
.
.
.
.
.
.
}
}
<pre>
And then I have tried overriding these MFC virtuals each separatley, but non were successful:
<pre>
LRESULT Cxxxx::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case MM_MCINOTIFY:
break;
}
return Cxxxx::DefWindowProc(message, wParam, lParam);
}
LRESULT Cxxxx::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case MM_MCINOTIFY:
break;
}
return Cxxxx::WindowProc(message, wParam, lParam);
}
<pre>
Any help is highly appreciated! :)
Thank you.
|
|
|
|
|
Did you specify the window to receive the messages? theApp.m_pMainWnd ?
MCI_DGV_PLAY_PARMS mciPlay;
DWORD dwFlags;
mciPlay.dwCallback = MAKELONG(hwnd, 0);
dwFlags = MCI_NOTIFY;
mciSendCommand(wMCIDeviceID, MCI_PLAY, dwFlags, (DWORD)(LPSTR)&mciPlay);
If so, I would think what you are doing would work - you could even use an ON_MESSAGE macro to trap it. Does it arrive in PreTranslateMessage?
|
|
|
|
|
Hi Tim!
Thank you for your reply.
I tried the ON_MESSAGE, not good either!
I also forgot to mention that it is a dialog based one. I'll try your way and let you know if it worked! Thanks meanwhile!
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
I want to use CFontDialog for change the font and color in edit box:
[ccode]
void CTestDlg::OnButton1()
{
LOGFONT lf;
CFont *font = new CFont();
CFontDialog FontDlg(&lf);
if(FontDlg.DoModal() == IDOK)
{
font->CreateFontIndirect(&lf);
m_edit.SetFont(font);
}
}
[/ccode]
Now, i want to change color ...
Please help me.
Hadi Rezaie
|
|
|
|
|
I tend to set up the font a little more ( to Arial 12 FWIW ), but as to your question, I'm not sure what you are asking.
Possibility 1: you want to draw the text and use a particular colour : use CDC::SetTextColor to make your text draw in the colour you want
Possibility 2: you don't want to be limited by the colours in the CFontDialog box - use a CColorDialog to choose anby available colour
Possibility 3: you want your text to display somewhere in this colour but don't know were to put the value - the LOGFONT structure does not contain a colour, you need to store it seperately ( I think CFontDialog has a GetColor method, it's something like that anyhow ) and then again use CDC:SetTextColor to set the colour the text will be drawn with into a DC. I confess to not being sure how else you'd set up text in a dialog item ( such as a CStatic ). My first approach would be to use myItem->SetFont(font); myItem->GetDC()->SetTextColor(rgbCol);
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Thanks alooooooot,
Hadi Rezaie
|
|
|
|
|
Does anyone knows how to do multicolor text in a CEdit control?
|
|
|
|
|
No, I suspect you'll need to use a rich edit. To use one, don't forget to call AfxInitRichEdit(); in your constructor, and definately read your MSDN, they are odd beasts.
Reality check here - why do the Redmondians require me to call AfxInitRichEdit(); ??? Is there a possibility I put a rich edit in my dialog because I DON'T want it to work ?????
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|