|
You can to convert the frames received from the camera to bitmap classes or BITMAPINFO structs. for example, something like:
void CCameraView2::ProcessFrame(UINT8 *pData,UINT32,UINT8 Redraw)
{
UINT32 BytesPerDstPix;
if(m_pBitmapInfo)
{
BytesPerDstPix=3;
switch(m_ColorMode)
{
case CM_Y8 : memcpy(m_pImage,pData,(UINT32)m_XSize*(UINT32)m_YSize);
BytesPerDstPix=1;
break;
case CM_RAW8 : ConvertRawY8(m_XSize,m_YSize,pData,m_pImage,m_BayerPattern);
break;
case CM_RGB8 : ConvertRGB(m_XSize,m_YSize,pData,m_pImage);
break;
...
|
|
|
|
|
Hi Jonathan
Thanks for your reply. Unfortunately I am still confused on exactly how this works.
In various examples (from various sites), I have seen the bitmap class and the BITMAPINFO structs used with images loaded from file or the resources. However, I could not find anything that uses an image (referenced by a pointed) already in the memory and somehow (either through picture control or whatever means) onto the MFC dialog GUI. Do you have any examples? Or even if you could point me into the right direction, that would be awesome!
I hope this is clear.
Thank again for your help. Really appreciate it.
|
|
|
|
|
Hi,
I used the following comment in one of my programs:
BITMAPINFO *m_pBitmapInfo;
So say you have a certain type of camera, once you've set it up etc, the dimensions, the way the colours are defined, whether the image is in top-down or bottom-up format, black/white or colour, all this sort of stuff is likely to stay the same for each frame you receive from your camera.
You need this sort of information about the picture plus the actual data/bytes that make up the image.
My approach (but there may be others) sets up exactly what you would have if you'd loaded a .bmp file from disc with all the information but then combines it with the actual image data feom the camera to produce a complete bitmap or CBitmap object in MFC.
You could have a look at how the BITMAPINFO and BITMAPINFOHEADER structures are made up which might help.
|
|
|
|
|
Hi again,
You say you can get the data, which presumably is in some image, picture or video format, for example: perhaps it is in YUV422. Basically find or write some code that will covert between this format and the Bitmap format you're almost there. If you're into this to write some MFC code do the former. If you're aim is to only to see the pictures from your camera try the latter.
|
|
|
|
|
hi,
I want to write my code ( Vc++) in txt file then I want to compile it, how I do that?
Thank you
thank you
soso
|
|
|
|
|
anassamar wrote: I want to write my code ( Vc++) in txt file...
As opposed to what other kind of file?
anassamar wrote: ...then I want to compile it, how I do that?
My first guess would be...with a compiler.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
DavidCrow wrote: As opposed to what other kind of file?
A .cpp file for instance ?
|
|
|
|
|
visual studio requires you to have a project & workspace in order to compile anything. Make a new project (it will create a workspace automatically) and then figure out how to "add a source file" to the project. Then you can compile it.
Projects & Workspaces are things that help organize different projects that a coder might otherwise just be sticking in a directory labeled, "/usr/home/mystuff/".
|
|
|
|
|
anassamar wrote: I want to write my code ( Vc++) in txt file then I want to compile it, how I do that?
What do you mean exactly ? You want to load a text file at run-time and execute the code in that file at run-time ? If yes, then C++ is not meant for that. C++ is a compiled language and you can't execute code this way. You will need to use a scripting language for that purpose instead.
|
|
|
|
|
"make file" seems can,but i don't know how to do it!
|
|
|
|
|
I want to change the text color and add some tooltip to the texts in the CListBox control.
I am adding the strings to the list as follows:
CListBox m_drivelist;
m_drivelist.AddString(str);
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
apr~asp wrote: I want to change the text color...the texts in the CListBox control.
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hello,
I have 2 control lists with the following Extended Style:
m_List.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER|LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS );
m_Group.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER| LVS_SHOWSELALWAYS |LVS_EX_FULLROWSELECT);
I am having a problem in keeping the row highlighted when I lose focus from either of the control list.
What have I set wrong or what could I be doing wrong?
Thanks a million.
|
|
|
|
|
FISH786 wrote: m_List.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER|LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS );
Some of those are not extended styles.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I guess the question is how do I keep the row selected? or do I have to set the background color just before I lose focus in order to accomplish what I need?
thanks.
|
|
|
|
|
FISH786 wrote: I guess the question is how do I keep the row selected?
By setting the LVS_SHOWSELALWAYS style (at design time).
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I guess I am doing something wrong..Cause I have the property set as true.
Not sure what else to change..
Short of setting the backgroud color of the row. I have tried everything I could think of.
Any other suggetion or can you think of anything I could be doing wrong?
Thanks a million.
|
|
|
|
|
I tried this and the selected item in the list control remained selected, albeit in a different color, when the list control lost focus.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
ok...I will try it again...thanks a million
|
|
|
|
|
The row stays selected and is highlighted - but the highlighting changes colour when the control loses focus - I don't believe there's nything you can do about that without making the control owner-draw.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I was trying to avoid using custom draw.. When I look at the control very closly yes the row is still selected but the color is a very light color. I can barely notice it as been highlighted.
Thanks a million for replying.
|
|
|
|
|
Hi all,
Recently,I have to design a small soft,but how to make the software interface on our own style is beyond us.As we all known, the window created by MFC is very ugly.Some software interface is so attractive,but how to imatate?(English is not my mother language and this is my first time ashing question,I am sorry I can't declared my doubt clearly.)
Thanks
|
|
|
|
|
wb_program wrote: Some software interface is so attractive,but how to imatate?(
Why not ?
Which one you want to imitate ?
|
|
|
|
|
wb_program wrote: As we all known, the window created by MFC is very ugly.
Which is your opinion, not everyone elses.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|