|
Hi There ,
MFC architecture is too big to be discussed on a forum .
I would suggest you go through the book of Jeff Prosise, to understand it better .
Sujay Ghosh
Blog : http://sujay-ghosh.blogspot.com
|
|
|
|
|
|
|
For an insider understanding of MFC, you can have a look at the MFC Internals[^] books.
Nihil obstat
|
|
|
|
|
MFC Internals would be too much for him. Right now , he is trying to understand the MFC architecture .
Blog : http://sujay-ghosh.blogspot.com
|
|
|
|
|
If I remember correctly, that book, while being more "advanced", was a good reading and help understanding the mess that was MFC; it is a little better now.
Nihil obstat
|
|
|
|
|
Hey guys!
Does any of you have an idea how GDI+ -when filling a rectangle or a region with a color that has an alpha component set- decides to use dithering instead of "real" blending? We are using a third-party library to generate PDF files. When using a printer DC as a "reference" to generate the PDF document, GDI+ seems to use "normal" color blending when filling an area with a translucent color, but when using a screen DC to do the same it "magically" decides to use dithering which produces a "less satisfying" result.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
In many cases, the device driver determines how the GDI+ functions operate.
The printer driver for your printer may not support alpha blending.
You might try using a memory DC to build up your graphics, then blitting that to your printer DC.
|
|
|
|
|
It's the other way around actually (read my original post again), when using the printer, i get alpha, when using a screen based DC, i get dithering, this is why i don't understand it, since i KNOW that i can use e.g. AlphaBlend[^] on the screen without any problems, or if i use GetDeviceCaps[^] on the screen DC i see that it supports blending.
I kinda know that the capabilities of the device is -at least usually- determined by the driver "under" it, what i would like to know is what GDI+ does to come to the conclusion that the screen-based device is incapable of blending and thus resorts to "low quality" dithering.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
If you're getting dithering, then your bits per pixel may be set to less than 24 bits.
Like I said, the device drivers do most of that work. GDI+ doesn't really make any decisions.
I've never seen reliable results in alpha blending from GDI+. I avoid it and either write my own code to do it, or use OpenGL.
|
|
|
|
|
hi all,
i want to get window color that is appear on window border,start menu and taskbar.
how can i do this?
thanks in advance.
|
|
|
|
|
|
yes i already use this .
i am using windows 7, and set Leaf color here "Control Panel\Appearance and Personalization\Personalization\Window Color and Appearance"
but using GetSysColor this color cant get even i chk this for all values.
please help me which value is use to get this color?
thanks.
|
|
|
|
|
|
HTHEME hTheme = ::OpenThemeData(NULL, VSCLASS_TASKBAND);
ATLASSERT(hTheme);
COLORREF clrText = 0;
if(hTheme)
{
const HRESULT hr = ::GetThemeColor(hTheme, TDP_GROUPCOUNT, 0,
TMT_BORDERCOLOR, &clrText);
ATLASSERT(SUCCEEDED(hr));
::CloseThemeData(hTheme);
}
::FillRect(pDC->m_hDC, &banner_rect, ::GetSysColorBrush(CTLCOLOR_DLG));
::DrawThemeParentBackground(obj_RecProfDlg->GetSafeHwnd(), pDC->m_hDC, &banner_rect);
but its not useful
so please help me ,what values i can use GetThemeColor
thanks.
|
|
|
|
|
hi all,
i want t draw banner and button for the dialog box according to current system theme.
please help me how can i do this.
thanks in advance.
|
|
|
|
|
For button, you can use CBitmapButton[^], and for the banner, you can use CStatic[^], where you can put there a bitmap, like banner ... of course, you can find here a derived CButton controls ...
|
|
|
|
|
i dont want to use image for this.
i want to get current system theme and its color than according to this draw the graphics.
what can i do for this?
thanks.
|
|
|
|
|
Well, then you only must setup a style for your application (setup manifest file) and you'll have a current system style on your button and CStatic. If I well understand ...
|
|
|
|
|
yes
how can use setup style?
|
|
|
|
|
Very simple: add manifest file in your project resource folder, and then open Resource.h:
#if _MSC_VER <= 1200
#ifndef IDR_MANIFEST
#define IDR_MANIFEST 1
#endif
#ifndef RT_MANIFEST
#define RT_MANIFEST 24
#endif
#endif // _MSC_VER <= 1200
if you don't have a manifest file, I could send you through email ...
Check here[^] too.
modified 16-Jan-13 4:24am.
|
|
|
|
|
Take a look at this section on MSDN[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
i have written a code in C++ for employees using OOP .. and after building it ,this error message appear : "
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup "
can anybody tell me what does that mean ? & and what should i do to run the program ?
|
|
|
|
|
See here[^], a solution of your problem.
|
|
|
|
|
I'm guessing that you selected the project type as Windows Application and wrote a main function.
Windows applications expect to find WinMain instead of main .
You can either create a project of type Console Application or change main to WinMain .
|
|
|
|