|
|
I use AlphaBlend blend the src( 0, 255, 0, 0 ) on dst( 128,128,128 ),expecting the result color should be the same as the dst( 128, 128, 128 ). But the result is ( 255, 128, 128 ). I have spent 5 hours try to find something, but unluckily I find nothing. it drives me crazy.
Could someon help me?
|
|
|
|
|
What are your BLENDFUNCTION values?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
BlendFunction.BlendOp = AC_SRC_OVER
.blendflag = 0
.SCA = 255
.AlphaFormat = AC_SRC_ALPHA
My bmp is per-pixel alpha channel bitmap.
I googled something articles and turuned out I didn't do the premultiple, but I am still comfused with the following formula:
Dst.Red = Src.Red + (1 - Src.Alpha) * Dst.Red
where the Src.alpha's value making sense should be 0.0 - 1.0, but it is 0 - 255. I wonder OS translate the alpha value in background for us?
|
|
|
|
|
how to change selection-background-color of a CRichEditCtrl?
Default selection-background-color is black, I did see some software have other selection-background-color on their CRichEditCtrl.
How to do it?
.
|
|
|
|
|
MFC doesn't have WM_SETFONT message handle, such as OnSetFont(...), how to add it as standard MFC handle?
I mean, not use WindowProc(...) etc.
.
|
|
|
|
|
Are you wanting to intercept the WM_SETFONT message? Do you have a custom control that has a WndProc() function?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I think you can use ON_MESSAGE
0N_MESSAGE(WM_SETFONT, OnSetFont)...
where OnSetFont is declared as afx_msg LRESULT OnSetFont(WPARAM, LPARAM). and WPARAM contains HFONT.
http://www.mono-project.com/Main_Page
|
|
|
|
|
venkatmakam wrote: 0N_MESSAGE(WM_SETFONT, OnSetFont)...
While you probably meant ON_MESSAGE() , isn't that for user-defined messages and less-common Windows messages?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
you do ask a lot of questions, don't you?
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
Um, yeah.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
WM_SETFONT is a message sent TO a window (control). That's why it doesn't have a handler macro.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
i am using a toolbar in a PropertyPage as part of a wizard
This works fine the first time, but if i access the wizard again, and that particular page then the toolbar fails to load
Can anyone help
im using the below code
if(!m_toolBar3.CreateEx(this, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS |CBRS_FLYBY | TBBS_BUTTON) || !m_toolBar3.LoadToolBar(IDR_TOOLBAR1))
AfxMessageBox("failed");
m_toolBar3.SetButtonInfo(m_toolBar3.CommandToIndex(ID_FILE_SAVE)+1,ID_SEPARATOR,TBBS_SEPARATOR,5);
m_toolBar3.SetButtonInfo(m_toolBar3.CommandToIndex(ID_EDIT_DELETE)+1,ID_SEPARATOR,TBBS_SEPARATOR,5);
m_toolBar3.SetButtonInfo(m_toolBar3.CommandToIndex(ID_EDIT_UNDO)+1,ID_SEPARATOR,TBBS_SEPARATOR,5);
m_toolBar3.SetButtonInfo(m_toolBar3.CommandToIndex(ID_APP_ABOUT)+1,ID_SEPARATOR,TBBS_SEPARATOR,5);
m_toolBar3.SetButtonInfo(m_toolBar3.CommandToIndex(ID_COLOUR)+1,ID_SEPARATOR,TBBS_SEPARATOR,5);
m_toolBar3.SetButtonStyle(m_toolBar3.CommandToIndex(ID_BOLD),TBBS_CHECKBOX);
m_toolBar3.SetButtonStyle(m_toolBar3.CommandToIndex(ID_UNDERLINE),TBBS_CHECKBOX);
m_toolBar3.SetButtonStyle(m_toolBar3.CommandToIndex(ID_ITALIC),TBBS_CHECKBOX);
m_toolBar3.SetButtonStyle(m_toolBar3.CommandToIndex(ID_PARAGRAPH_LEFT),TBBS_CHECKGROUP);
m_toolBar3.SetButtonStyle(m_toolBar3.CommandToIndex(ID_PARAGRAPH_CENTER),TBBS_CHECKGROUP);
m_toolBar3.SetButtonStyle(m_toolBar3.CommandToIndex(ID_PARAGRAPH_RIGHT),TBBS_CHECKGROUP);
m_toolBar3.SetButtonStyle(m_toolBar3.CommandToIndex(ID_PARAGRAPH_BULLETED),TBBS_CHECKBOX);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0);
m_toolBar3.MoveWindow( 18, 134,450, 30, 1 );
thanks
Simon
|
|
|
|
|
Hi:
first i invoke CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5) create a HRGN, then Invoke SetWindowRgn.
SetWindowRgn is successful But RoundRect(hdc, rc.left, rc.top, rc.right, rc.bottom, 5, 5) can not Draw round border,
I am surprised Because RoundRect Draw the top and left border, but not draw right and bottom border. Please Help me thanks.
the code as follow:
HRGN hRgn = CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5);
::SetWindowRgn(hwnd, hRgn, TRUE);
RoundRect(dcMem, rc.left, rc.top, rc.right, rc.bottom, 5, 5);
|
|
|
|
|
how you are calculating rc?
http://www.mono-project.com/Main_Page
|
|
|
|
|
calculate like this:
RECT rc;
GetWindowRect(hwnd,&rc);
OffsetRect(&rc,-rc.left,-rc.top);
|
|
|
|
|
thanks the problem is solved
|
|
|
|
|
|
And your question is....?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
This is information based on a previous issue (also in Delphi forum) by OP.
The best things in life are not things.
|
|
|
|
|
Is this related to C/C++ in any way?
|
|
|
|
|
See above.
The best things in life are not things.
|
|
|
|
|
|
But this still does not fix your problem as far as I can see. It is still not possible to get the information out of the .lnk file. Or have I missed some extra information?
The best things in life are not things.
|
|
|
|
|
That is completely incomprehensible, so I'll have to go for a very wild guess.
If you make a shortcut file containing a URL (e.g. by dragging the content of the address bar from a browser to the desktop), then you get what is basically a text file; the second line contains
URL=the URL your browser was showing at the time
so some simple read-string-from-file operations can give you the URL string.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|