gpt4 book ai didi

winapi - 从 tagRECT/CRect 转换为 Gdiplus::Rect

转载 作者:行者123 更新时间:2023-12-03 23:38:12 25 4
gpt4 key购买 nike

转换 RECT 的最简单方法是什么?结构 ( tagRECT ) 或 CRectGdiplus::Rect ?

Gdiplus::Rect tmpRect(rect.top, rect.left, rect.Width(), rect.Height());

工作,但打字很多。

最佳答案

签名是Rect([in] INT x, [in] INT y, [in] INT width, [in] INT height);所以应该是

Gdiplus::Rect CopyRect(RECT &rect)
{
return Gdiplus::Rect(rect.left, rect.top, rect.Width(), rect.Height());
}

关于winapi - 从 tagRECT/CRect 转换为 Gdiplus::Rect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/461396/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com