开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 214|回复: 2
收起左侧

[完成] win11圆角例子

 关闭 [复制链接]
结帖率:92% (33/36)
发表于 3 天前 | 显示全部楼层 |阅读模式   山东省青岛市
30精币

有没有不用客户区拓展能在其他系统模仿这个圆角+阴影效果的,EXUI我模仿的没那么好,我目前实现的圆角在附件


补充内容 (2026-4-10 19:49):
附件没了,能模仿这个吗
e963ed791c461bcc1b1798cc662b9f71.png

最佳答案

查看完整内容

直接导入图片即可

签到天数: 12 天

发表于 3 天前 | 显示全部楼层   广东省湛江市
直接导入图片即可

圆角.e

8.82 KB, 下载次数: 7, 下载积分: 精币 -1 枚

回复

使用道具 举报

结帖率:100% (6/6)

签到天数: 12 天

发表于 3 天前 | 显示全部楼层   安徽省蚌埠市
GDI+ 直接画  或者d2d 或者skia 都行。。。GDI+圆角有锯齿 根据这个开 锯齿就没了 阴影自己根据窗体边缘画 void Form::RenderContent() {     if (!m_hWnd || !m_mainBitmap) return;     int totalWidth = m_mainBitmap->GetWidth();     int totalHeight = m_mainBitmap->GetHeight();     Gdiplus::Graphics graphics(m_mainBitmap.get());     graphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);     graphics.SetInterpolationMode(Gdiplus::InterpolationModeBicubic);     Gdiplus::GraphicsPath updatePath;      if (m_forceFullRedraw || m_isStaticBackgroundDirty) {         if (m_isStaticBackgroundDirty || !m_staticBackgroundCache) {             m_staticBackgroundCache = std::make_unique<Gdiplus::Bitmap>(totalWidth, totalHeight, PixelFormat32bppARGB);             Gdiplus::Graphics bgGraphics(m_staticBackgroundCache.get());             bgGraphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);             bgGraphics.SetPixelOffsetMode(Gdiplus::PixelOffsetModeHalf);             ///*graphics.SetPageUnit(Gdiplus::UnitPixel);*/             bgGraphics.SetInterpolationMode(Gdiplus::InterpolationModeBicubic);              bgGraphics.Clear(Gdiplus::Color(0, 0, 0, 0));             if (m_isShadowDirty || !m_shadowCache) {                 m_shadowCache = std::make_unique<Gdiplus::Bitmap>(totalWidth, totalHeight, PixelFormat32bppARGB);                 Gdiplus::Graphics shadowGraphics(m_shadowCache.get());                 shadowGraphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);                 shadowGraphics.SetPixelOffsetMode(Gdiplus::PixelOffsetModeHalf);                 shadowGraphics.SetInterpolationMode(Gdiplus::InterpolationModeBicubic);                 shadowGraphics.Clear(Gdiplus::Color(0, 0, 0, 0));                 for (int i = 0; i < m_shadowLayers; ++i) {                     Gdiplus::REAL currentSpreadFactor = static_cast<Gdiplus::REAL>(i) / std::max<Gdiplus::REAL>(1, static_cast<Gdiplus::REAL>(m_shadowLayers) - 1);                     Gdiplus::REAL actualSpread = m_shadowSpread * currentSpreadFactor;                     double normalizedPos = static_cast<double>(i) / std::max<double>(1, m_shadowLayers - 1);                     int currentAlpha = static_cast<int>(m_shadowMaxAlpha * (1.0 - normalizedPos));                     currentAlpha = std::max<int>(0, std::min<int>(255, currentAlpha));                     Gdiplus::RectF shadowRect(m_shadowSpread - actualSpread, m_shadowSpread - actualSpread, m_clientWindowWidth + 2 * actualSpread, m_clientWindowHeight + 2 * actualSpread);                     Gdiplus::GraphicsPath layerPath;                     CreateRoundedRectPath(layerPath, shadowRect, m_cornerRadius + actualSpread);                     Gdiplus::SolidBrush shadowBrush(Gdiplus::Color(currentAlpha, 0, 0, 0));                     shadowGraphics.FillPath(&shadowBrush, &layerPath);                 }                 m_isShadowDirty = false;             }             bgGraphics.DrawImage(m_shadowCache.get(), 0, 0);             Gdiplus::RectF bodyRect = GetClientArea();             Gdiplus::GraphicsPath formBodyPath;             CreateRoundedRectPath(formBodyPath, bodyRect, m_cornerRadius);             Gdiplus::SolidBrush bodyBrush(From_background);             bgGraphics.FillPath(&bodyBrush, &formBodyPath);             m_isStaticBackgroundDirty = false;         }         graphics.Clear(Gdiplus::Color(0, 0, 0, 0));         graphics.DrawImage(m_staticBackgroundCache.get(), 0, 0);         for (const auto& element : m_elements) {             if (element->IsVisible()) {                 element->Draw(graphics);             }         }         updatePath.AddRectangle(Gdiplus::RectF(0, 0, static_cast<Gdiplus::REAL>(totalWidth), static_cast<Gdiplus::REAL>(totalHeight)));     }
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报QQ: 793400750,邮箱:wp@125.la
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备2025452707号) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表