|
Does anyone here have any experience with using either or both the Windows Media Encoder SDK and/or the Windows Media Format SDK? If so I hope you can help me answer the following question. Using these SDKs I am able to create a profile, create an encoding session, and run this session, I only have one drawback. I cannot correctly specify the audio codec in the profile. I set the WM_MEDIA_TYPE.subtype parameter to be equal to the GUID of the codec I want to use and cannot properly create a profile. But, when I compare the .prx file this profile was saved to against another .prx file that a profile created using the profile manager (with the same parameters as the profile I created using the SDKs) I have one difference in the audio setup. There is a field named codecdata in the .prx file that differs, even though I have set the same parameters in both profiles (one created with the SDKs does not match up to the one I created with the profile manager). Can anyone help me with this problem? If so I will very much appreciate it! Thanks in advance.
Roger Printy
Software Engineer
TeraNex
Orlando, FL
|
|
|
|
|
Does anyone here have any experience with using either or both the Windows Media Encoder SDK and/or the Windows Media Format SDK? If so I hope you can help me answer the following question. Using these SDKs I am able to create a profile, create an encoding session, and run this session, I only have one drawback. I cannot correctly specify the audio codec in the profile. I set the WM_MEDIA_TYPE.subtype parameter to be equal to the GUID of the codec I want to use and cannot properly create a profile. But, when I compare the .prx file this profile was saved to against another .prx file that a profile created using the profile manager (with the same parameters as the profile I created using the SDKs) I have one difference in the audio setup. There is a field named codecdata in the .prx file that differs, even though I have set the same parameters in both profiles (one created with the SDKs does not match up to the one I created with the profile manager). Can anyone help me with this problem? If so I will very much appreciate it! Thanks in advance.
Roger Printy
Software Engineer
TeraNex
Orlando, FL
|
|
|
|
|
I have a static control.
In this control I want to draw a bitmap first (a compass) and afterwards I
draw the pointer (the pointer indicates which way the wind goes).
I do this in the OnPaint Function of the Class CWindrose (derived from CStatic).
This function looks like this:
void CWindrose::OnPaint()
{
DrawTransparent(...);
DrawPointer(...);
}
So everything works fine.
My problem is the flicker that appears everytime the OnPaint Function is called.
So:
How to call the bitmap to repaint just the pixels which are changed ???????
P.S.:
This is the Drawing function:
EFErr CWindrose::DrawTransparent(CDC *pDC, int x, int y, COLORREF crColour,CBitmap &Bmp)
{
COLORREF crOldBack = pDC->SetBkColor(RGB(255,255,255));
COLORREF crOldText = pDC->SetTextColor(0);
CDC dcImage, dcTrans;
// Create two memory dcs for the image and the mask
dcImage.CreateCompatibleDC(pDC);
dcTrans.CreateCompatibleDC(pDC);
// Select the image into the appropriate dc
CBitmap* pOldBitmapImage = dcImage.SelectObject(&Bmp);
// Create the mask bitmap
CBitmap bitmapTrans;
BITMAP bm1;
Bmp.GetBitmap(&bm1);
int nHeight= bm1.bmHeight;
BITMAP bm2;
Bmp.GetBitmap(&bm2);
int nWidth = bm2.bmWidth;
bitmapTrans.CreateBitmap(nWidth, nHeight, 1, 1, NULL);
// Select the mask bitmap into the appropriate dc
CBitmap* pOldBitmapTrans = dcTrans.SelectObject(&bitmapTrans);
// Build mask based on transparent colour
dcImage.SetBkColor(crColour);
dcTrans.BitBlt(0, 0, nWidth, nHeight, &dcImage, 0, 0, SRCCOPY);
// Do the work - True Mask method - cool if not actual display
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
pDC->BitBlt(x, y, nWidth, nHeight, &dcTrans, 0, 0, SRCAND);
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
// Restore settings
dcImage.SelectObject(pOldBitmapImage);
dcTrans.SelectObject(pOldBitmapTrans);
pDC->SetBkColor(crOldBack);
pDC->SetTextColor(crOldText);
RET_JA
}
|
|
|
|
|
you might want to take a look at CDC::GetClipRect. this will tell you the rect you need to update.
also, you might want to override OnDrawBackground, to avoid drawing the background...
-c
|
|
|
|
|
Am I right in thinking your OnPaint calls this function and passes it's DC pointer to it ? Any sort of drawing, especially the transparent drawing ( which involves three BLT's ) should be done to a buffer DC, and that DC copied to the screen in one blt. This will save you a world of hurt. Also, if you call Invalidate with a false parameter, it won't erase the background, saving you another flicker. You can override OnEraseBackground, as has been suggested, but I can't imagine it overly likely that you'll never want the erase the background ? For example, overriding it so it is never called will give you some interesting transparency effects where you can see the dialog underneath. ( before you get too excited, when you MOVE the dialog you can see where it WAS, not where it IS ).
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,
this is my Win32 version you can see that I have extra CreateCompatibleBitmap and extra BitBlt.
Good luck,
Dror
void MyTransparentBlt( HDC hdcDest, int nXDest, int nYDest, int nWidth,
int nHeight, HDC hBmpDC/*, HBITMAP hBitmap*/, int nXSrc, int nYSrc,
COLORREF colorTransparent, HPALETTE hPal)
{
HDC hdcMask = ::CreateCompatibleDC( hdcDest );
HDC hdcTmp = ::CreateCompatibleDC( hdcDest );
HBITMAP bmMask = ::CreateBitmap( nWidth, nHeight, 1, 1, NULL );
HBITMAP hOldMaskBitmap = (HBITMAP)::SelectObject( hdcMask, bmMask );
HBITMAP hTmpBmp = CreateCompatibleBitmap(hdcDest, nWidth, nHeight);
HBITMAP hOldTmpBmp = (HBITMAP)::SelectObject(hdcTmp, hTmpBmp);
::BitBlt(hdcTmp, 0,0,nWidth, nHeight, hBmpDC, nXSrc, nYSrc, SRCCOPY );
::SetBkColor( hdcTmp, colorTransparent );
::SetTextColor( hBmpDC, RGB( 0, 0, 0 ) );
::BitBlt( hdcMask, 0, 0, nWidth, nHeight, hdcTmp, 0, 0, SRCCOPY );
HDC hdcOffScr = ::CreateCompatibleDC(hdcDest);
::SetBkMode(hdcOffScr, TRANSPARENT);
HBITMAP hbmOffScr = ::CreateBitmap(nWidth, nHeight,
(BYTE)GetDeviceCaps(hdcDest, PLANES),
(BYTE)GetDeviceCaps(hdcDest, BITSPIXEL),
NULL);
HBITMAP hbmOldOffScr = (HBITMAP)::SelectObject(hdcOffScr, hbmOffScr);
::BitBlt(hdcOffScr, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, SRCCOPY);
::SetBkColor( hBmpDC, RGB( 0, 0, 0 ) );
::SetTextColor( hBmpDC, RGB( 0xff, 0xff, 0xff ));
COLORREF crOldBackColor = ::GetBkColor( hdcDest );
COLORREF crOldTextColor = ::GetTextColor( hdcDest );
::SetBkColor( hdcOffScr, RGB( 0xff, 0xff, 0xff ) );
::SetTextColor( hdcOffScr, RGB( 0, 0, 0 ) );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hBmpDC, 0, 0, SRCINVERT );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hdcMask, 0, 0, SRCAND );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hBmpDC, 0, 0, SRCINVERT );
::SetBkColor( hdcOffScr, crOldBackColor );
::SetTextColor( hdcOffScr, crOldTextColor );
::SetBkMode(hdcDest, TRANSPARENT);
::BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcOffScr, 0, 0, SRCCOPY);
if ( hOldMaskBitmap )
::SelectObject( hdcMask, hOldMaskBitmap );
if ( hbmOldOffScr )
::SelectObject( hdcOffScr, hbmOldOffScr );
if ( hOldTmpBmp )
::SelectObject( hdcTmp, hOldTmpBmp );
::DeleteObject( hTmpBmp );
::DeleteObject( bmMask );
::DeleteObject( hbmOffScr );
::DeleteDC( hdcOffScr );
::DeleteDC( hdcTmp );
::DeleteDC( hdcMask );
}
|
|
|
|
|
I have a static control.
In this control I want to draw a bitmap first (a compass) and afterwards I
draw the pointer (the pointer indicates which way the wind goes).
I do this in the OnPaint Function of the Class CWindrose (derived from CStatic).
This function looks like this:
void CWindrose::OnPaint()
{
DrawTransparent(...);
DrawPointer(...);
}
So everything works fine.
My problem is the flicker that appears everytime the OnPaint Function is called.
So:
How to call the bitmap to repaint just the pixels which are changed ???????
P.S.:
This is the Drawing function:
EFErr CWindrose::DrawTransparent(CDC *pDC, int x, int y, COLORREF crColour,CBitmap &Bmp)
{
COLORREF crOldBack = pDC->SetBkColor(RGB(255,255,255));
COLORREF crOldText = pDC->SetTextColor(0);
CDC dcImage, dcTrans;
// Create two memory dcs for the image and the mask
dcImage.CreateCompatibleDC(pDC);
dcTrans.CreateCompatibleDC(pDC);
// Select the image into the appropriate dc
CBitmap* pOldBitmapImage = dcImage.SelectObject(&Bmp);
// Create the mask bitmap
CBitmap bitmapTrans;
BITMAP bm1;
Bmp.GetBitmap(&bm1);
int nHeight= bm1.bmHeight;
BITMAP bm2;
Bmp.GetBitmap(&bm2);
int nWidth = bm2.bmWidth;
bitmapTrans.CreateBitmap(nWidth, nHeight, 1, 1, NULL);
// Select the mask bitmap into the appropriate dc
CBitmap* pOldBitmapTrans = dcTrans.SelectObject(&bitmapTrans);
// Build mask based on transparent colour
dcImage.SetBkColor(crColour);
dcTrans.BitBlt(0, 0, nWidth, nHeight, &dcImage, 0, 0, SRCCOPY);
// Do the work - True Mask method - cool if not actual display
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
pDC->BitBlt(x, y, nWidth, nHeight, &dcTrans, 0, 0, SRCAND);
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
// Restore settings
dcImage.SelectObject(pOldBitmapImage);
dcTrans.SelectObject(pOldBitmapTrans);
pDC->SetBkColor(crOldBack);
pDC->SetTextColor(crOldText);
RET_JA
}
|
|
|
|
|
Hi all,
I currently working on a project where i need to embed at font in a
program, in the resource. The font must not be installed on the
system where the program runs, but only be available to the program when
the program runs.
My question how do i include a font (a true type font) in the resource,
and also how do i load it ? Can it be done ? Or is there another way
of doing this ??
Thanks,
Bo Helleskov/Denmak.
|
|
|
|
|
Did you ever get this working?
Cheers,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
How can I create a DC that is incompatible with the display?
Actually, what I really want to do is to always create and
work with 24-Bit images whatever the setting of my display
is. So, if I my monitor is set at 32-Bits. I'd still be
creating 24-bit images.
Right now, I create a DC that is compatible with the display.
Thus, the bitmaps are different depending on the display
properties.
eipangan
|
|
|
|
|
|
Hi, anybody who knows how to get / calculate the cpu-usage in % like the taskmanager of
Win 2000 does ?
Greatings Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
Look at the PERFMON example included with the MSDN
|
|
|
|
|
|
I have a problem.
I have a dialog box and in this dialog box there is a button. If I click this button it will open a new dialog box.
This new dialog box has a progress bar. My problem is, how can I trigger this new dialog box so that the progress bar will work after the dialog box is shown (without any using of other control ie: button, radio button or what ever). I try most of the ( WM_ ) message handler but I still can't found it.
|
|
|
|
|
Check out the doccumentation on CProgressCtrl, specifically: SetRange32, SetStep and StepIt.
|
|
|
|
|
Hi,
thanks for reading this. I'm working on a project where I have a large amount of structured data to manage. Similar to file directories. I've got a root folder, subfolders and eventually documents.
How do I deal with it in my program in a manner, that allows effectivly saving the data to a file (or multiple files?). Imagine me writing an application that stores the entire folder/file structure of a given disk. Each item (disk, folder, file) has it's own properties which have to be stored as well.
Any tips and links greatly appreceated.
Matthias
|
|
|
|
|
here is the question:
input: a directory name
output: All the files in that directory AND its sub-directories.
(in C/C++)
|
|
|
|
|
Take a look at the help in the MSDN of the functions related to this of the listboxes and comboboxes:
>> Dir and DlgDirList
You'll see that this is very easy.
PD. I think it can be done with a treeCtrl too.
(at last I must advice you that I'm just a begginer that some time ago had the same problem, it worked for me, but it can not-be the best solution)
|
|
|
|
|
I don't know how you would do it using the standard C library, but in Win32 use FindFirstFile and FindNextFile in a recursive function
|
|
|
|
|
First of all let me remember you that I'm a novice and that surely will be more effective ways of doing this.
After that little note, here's the code that I commented you:
BOOL CNavegadorRefsDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CString csFullPath = "";
int iLength = 0;
csFullPath.Format("%s\\%s.%s",
this->m_csPath,
this->m_csWildCardName,
this->m_csWildCardExt);
iLength = csFullPath.GetLength();
this->DlgDirList(csFullPath.GetBuffer(iLength),
IDC_lbRefs,
NULL,
NULL
);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
As you can see the code is implemented in the OnInitDialog f(x), but it can be placed where you need it.
regards, and I expect this helps.
|
|
|
|
|
I have an existing app that has a main frame.
I also have a separate application that I turned into an
extension DLL and exported a wrapper class for the creating
hiding, showing and deleting of this new frame.
I want to pull up the 2nd app in the first app.
The 1st frame is created and at a later time I create the second
frame. During the creation of the second frame I replace the m_pMainWnd
member of the app class.
I noticed that the m_pMainWnd pointer doesn't automatically get swapped.
Thus some of the messages going to the first frame end up getting handled
in the second frame.
Should I use the OnSetFocus to swap the proper m_pMainWnd handler?
Or is there a much better way to try to do what I am doing?
Thanks and Regards
Kevin
|
|
|
|
|
Hi,
With all those Visual C++ gurus around here at CodeProject, what about
joining forces to create a set of extensible classes aimed at providing
state-of-the-art UI?
I'm thinking about something like CodeJock that provides Office-like UI, or Outlook-like UI or Visual Studio-like UI for MFC, but for WTL. This will make use of multiple inheritance to allow for the 'don't pay for what you don't use' approach.
I think WTL is the way to go but lacks some nice UI features. I personnaly want to get involved in this but I think this should be a collective effort.
Will such an idea encounter enough enthusiasts? Is is worth setting up something here at CodeProject of SourceForge?
Waiting for your feedback, guys...
Cheers.
--
Maxime Labelle
maxime.labelle@freesurf.fr
|
|
|
|
|
Looking for a good sample on sockets, I know nothing about sockets.
Want to create a Listener.exe (wait for data to be sent to the socket)
When data is received, process the data,,,ie display on screen.
What to create a Sender.exe (send data to the socket)....
Any ideas? Just a simple example to carry out the basics...get me on the road....
Don't want to use wizards...just simple console apps in Visual C++ 5.0
|
|
|
|
|
Hello,
I have a probleme to use Visual C++ ( 6 ): ( with MFC )
_to make a ComboBox for all drives
_to make a ListBox with directories
_to make a ListBox with files
thx for your help
|
|
|
|
|