|
Instead of creating a button control, you can use DrawFrameControl(...) to draw a button in its various states and react to the cursor position to determine if the user is attempting to click that button.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
When I use GDI+ ,I Set the Mapmode to MM_LOMETRIC in OnPrepareDC of the View
. the code of OnDraw like below,but the "TEST" is seted to reverse and mirro .
very surperisely !
CXXView::OnDraw(CDC* pDC)
{
using namespace Gdiplus;
Graphics graphics(pDC->GetSafeHdc());
CRect rect(600,-700,800,-900);
const PointF p((rect.left+rect.right)/2,(rect.top+rect.bottom)/2);
GraphicsPath gp ;
RectF rf(rect.left,rect.top,rect.Width(),-rect.Height());
gp.AddRectangle(rf) ;
FontFamily fontFamily(L"Arial");
Font font(&fontFamily, 24, FontStyleBold, UnitPoint);
StringFormat stringFormat;
stringFormat.SetFormatFlags(StringFormatFlagsDirectionRightToLeft);
RectF fontRect(rect.left,rect.top,rect.Width(),-rect.Height()) ;
WCHAR str[] = L"TEST";
gp.AddString(str, (INT)wcslenstr),
&fontFamily,FontStyleBold,36,fontRect, &stringFormat);
SolidBrush solidBrush(Color(0, 0, 0, 0));
Pen pNewPen(Color::Black,3);
graphics.DrawPath(&pNewPen,&gp) ;
}
|
|
|
|
|
Hello Friends,
What is object slicing in c++ ? Why this feature used in c++ ? Is any advantage of object slicing in c++.
Kindly Help.
-PHIJO MATHEW PHILIP.
PHIJO MATHEW PHILIP
|
|
|
|
|
It's not a feature, it's more because you pass a polymorphic object by value instead of passing a pointer to it. So, your object is truncated and you have unexpected results. So, we cannot say that it has advantages
See at the bottom of this page[^] for more info.
|
|
|
|
|
Hi
I'm doing some finishing touch for my project, mostly improving the GUI.
My project is an SDI of Windows Explorer style with a tree view on the left.
The items in the tree correspond to e.g computers, some active and some idle. I want to have these active nodes blinking but I don't know how to do it, more specifically how to change the image of an tree item in run time.
I have think of one way: Using a timer, delete the node and reinsert it with different image when there is WM_TIMER. This way seems to work but it leads to some problems I don't want. More over, my program must run fast and stable so I don't want to use any kind of activeX, just MFC or Win API.
I've just run into VC++ for 1 month (although I have programed C++ on linux for years) so my question may be a little bit silly. please help me
thanks
|
|
|
|
|
Instead of deleting and readding the item, simply change its icon (you ARE using icons, right?) and redraw the item each time the timer fires, alternating between two or more icons (more icons can be used to animate a particular item).
If not using icons, you can use the TVIS_DROPHILITED and/or TVIS_BOLD item states to make the item itself flash. Look-up the TVITEM structure for more details on those states.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello Friend,
Can I call virtual fucnction from default constructor ?
Kindly see the C++ code given below
#include <iostream>
using namespace std;
class A
{
public:
A()
{
show();
}
virtual void show()
{
cout <<"virutal function inside the default constructor" << endl;
}
};
int main()
{
A obj;
return 0;
}
What is the techinal advantage and disadvantages of call virutal function from the base class defualt constructor ?
Kindly mention the place where this condition is used in c++ .
Kindly help.
-PHIJO MATHEW PHILIP.
|
|
|
|
|
The short answer is yes, but I would advise against it. A virtual method will propegate down to the derived class. But when you call the derived class' c'tor it will initialize the base class first. So, in the derived method, if you are relying on any members being initialized, they won't be. This may lead to hard to spot problems later in your code.
Pseudo code:
call derived c'tor<br />
call base c'tor<br />
initialize base members<br />
call virtual method<br />
use un-initialized derived member<br />
initialize derived members
|
|
|
|
|
Unless it is qualifid with the current class name, correct?
You can 'force' the virtual function of a specific, known baser class, to be invoked as long as you are at least derived from said baser class.
That would be safe.
|
|
|
|
|
Anything is safe as long as you know what you are doing. In the case of the poster though, it's not wise to baffle him with technicalities while he is just starting on the basics. Later, after he has got the basics under his thumb, is when he will start breaking the rules and pushing his code as far as it will give
|
|
|
|
|
|
Hello friends,
In operator overloading concept in c++ ,certain operators such as
sizeof : sizeof operator
. : membershsip operator
.* : pointer to member operator
:: : scope resolution operator
?: : conditional operator
cannot be overload in c++ , why it so ??
What is the technical reason behind it feature in c++?
-PHIJO MATHEW PHILP.
-PHIJO MATHEW PHILP.
|
|
|
|
|
|
One thing that it does not mention is that sizeof can be (or always is?) evaluated at compile time (at least by some compiler implementations). This would not be possible if it was overloaded, which requires runtime.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
In windef.h the two macros min and max are defined. Now I remember some time ago seeing a third macro, in somebody's sample code, which returned a value within a range. ie it accepted 3 paramaters, the value to test and the min and max values. The macro would test the value, if lower or higher than the min max, it would return the min or max, otherwise return the exisiting value.
It's possible this was a user defined macro, but just out of curiosity, does anybody know if it already exists?
|
|
|
|
|
something like this?
#define range(_x, _lo, _hi) (max(min((_x), (_hi)), (_lo))
or, even better:
template < class T> _inline T t_min (const T &i, const T &j)
{ return ((i < j) ? i : j); }
template < class T> _inline T t_max (const T &i, const T &j)
{ return ((i > j) ? i : j); }
template < class T> _inline T t_range (T _val, const T &_min, const T &_max)
{ return t_max(t_min(_val, _max), _min); }
template < class T> _inline T t_clamp (T _val, const T &_min, const T &_max)
{ _val = t_min(t_max(_val, _min), _max); return _val; }
|
|
|
|
|
Thanks for the templates. Did you create the macro or was it defined somewhere? I ended up creating my own similar to what you have given. But I am curious if it, or one similar, is already in a header file somewhere.
|
|
|
|
|
"create" is too strong a word for just, well, typing it in.
there might be an 'official' one out there somewhere, but it's not really worth looking for.
|
|
|
|
|
i am doing a project on image processing, i have to change higher bit to lower bit and brightness and contrast adjustments
ruth
|
|
|
|
|
Look for a graphics library called "freeimage". It's a quality library (better than CXImage here on CodeProject), and I'm sure it can handle any image processing you might need to perform.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
scalar quantization first using 24-bit
then converse to 16 or 8 bit
just do it
|
|
|
|
|
HI,
I have to do a project on image processing.
How can i recognize skinwounds from normal skin??
Any suggestions??!!
Regards, Atbir
|
|
|
|
|
atbir wrote: I have to do a project on image processing.
For who ?
atbir wrote: How can i recognize skinwounds from normal skin??
Because scabs are red ?
What sort of wounds ? What sort of images ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I don't know, check for smooth skin surfaces vs. non-smooth skin surfaces ? do an edge detection and check for edges on the skin ?
me think it's a hard task.
|
|
|
|
|
Hi,
I would start with GIMP or any other popular image processing programme, and experiment with some functions to obtain clear view of such wound, that would be easy to recognize from the rest of the skin. Then you can try to find out how to implement algorithms used to obtain this effect. For example, by using gaussian blur and emboss, you can get clear view of bumps on the skin. By using 3d projection, you can even detect, how deep is such wound. Just a thought.
Hope that helps.
Regards
|
|
|
|
|