|
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 .
|
|
|
|
|
Start here.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
In case I have asked this before, but OF does not remember, accept my apology.
I believe this is pretty generic situation so I ll try to explain it without code.
I have VFW capAPI which registers a callback function and than initializes the callback rate.
The callback function allows me to modify the data before it is displayed.
I have not figured out how this display really works, but it does, non issue for now.
The callback rate is adjustable in milliseconds, and if I set it to 20 and let the callback function just return, without modifying the data, in debug mode, the display goes from good bitmap to blank pretty rapidly.
If I set the rate to 2 seconds there still are occasional blank screens.
I was under the impression that callbacks are executed by the system when data became available, but it seem that in VFW API the rate executes the callback even with no or bad data.
I did check that and one of the parameters in the callback – number of bytes actually used _ is “a lot less” than when true number of bytes used.
So even if I check for “blanks / invalid “ data I will still have problem unless I can keep track of good data and substitute them for bad ones.
I am just posting this in case someone has an experience with this behavior.
This seems to be a major issue in VFW , but replacing VFW with DirectX is not an option.
I would also like to know how to access the callback function return value.
The function is defined as global. Do I need to make it static class function to be able to use the return value?
Is it also possible that I am missing some “buffers”? I recall having a great time using another AVI. Maybe I need to shrink my bitmap.
Thanks for your time, appreciate it.
Cheers Vaclav
|
|
|
|
|
CTempLock (&(this->m_Lock));
m_Lock a CCriticalSection.
There is a variable without name? what is it?
|
|
|
|