What is the easiest way to convert a RECT
struct (tagRECT
) or a CRect
to a Gdiplus::Rect
?
Gdiplus::Rect tmpRect(rect.top, rect.left, rect.Width(), rect.Height());
works but is a lot of typing.
What is the easiest way to convert a RECT
struct (tagRECT
) or a CRect
to a Gdiplus::Rect
?
Gdiplus::Rect tmpRect(rect.top, rect.left, rect.Width(), rect.Height());
works but is a lot of typing.
If the interface for Gdiplus::Rect doesn't have a convenient constructor, you can make your own function once and use it everywhere.
Gdiplus::Rect CopyRect(RECT &rect)
{
return Gdiplus::Rect(rect.top, rect.left, rect.Width(), rect.Height());
}