当前位置: 首页 > news >正文

主流网站开发技术框架如何看一个网站是否做推广

主流网站开发技术框架,如何看一个网站是否做推广,建筑网图,导视设计报价一、起因 关于winform窗体无边框的问题很简单#xff0c;只需要设置winform的窗体属性即可#xff1a; FormBorderStyle FormBorderStyle.None; 但是这中无边框窗口实现的效果和背景完全没有层次的感觉#xff0c;所以能加上阴影#xff0c;突出窗口显示的感觉。 二、…一、起因 关于winform窗体无边框的问题很简单只需要设置winform的窗体属性即可 FormBorderStyle FormBorderStyle.None; 但是这中无边框窗口实现的效果和背景完全没有层次的感觉所以能加上阴影突出窗口显示的感觉。 二、网上搜索的解决方案 方法 1 首先发现了使用 user32.dll 中方法实现的方案 C# WinForm无边框窗体设置阴影效果 缺点这种方法只能实现右边和下边的阴影效果效果不是很好。 效果如图 方法 2 然后发现了使用双层窗体底层窗体贴阴影的PNG来实现的方式 教你实现Winform窗体的四边阴影效果 缺点PNG格式特点是支持alpha通道半透明但是放大会失真 效果如图 三、最终解决方案 我使用的方法是绘制阴影到bitmap上然后使用双层窗体的原理把bitmap绘制到背景层上去。 其中比较重要的是 1、绘制圆角矩形 public static void DrawRoundRectangle(Graphics g, Pen pen, Rectangle rect, int cornerRadius) {using (GraphicsPath path CreateRoundedRectanglePath(rect, cornerRadius)){g.DrawPath(pen, path);} } public static void FillRoundRectangle(Graphics g, Brush brush, Rectangle rect, int cornerRadius) {using (GraphicsPath path CreateRoundedRectanglePath(rect, cornerRadius)){g.FillPath(brush, path);} } internal static GraphicsPath CreateRoundedRectanglePath(Rectangle rect, int cornerRadius) {GraphicsPath roundedRect new GraphicsPath();roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);roundedRect.AddLine(rect.X cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);roundedRect.AddArc(rect.X rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);roundedRect.AddLine(rect.Right, rect.Y cornerRadius * 2, rect.Right, rect.Y rect.Height - cornerRadius * 2);roundedRect.AddArc(rect.X rect.Width - cornerRadius * 2, rect.Y rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X cornerRadius * 2, rect.Bottom);roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y cornerRadius * 2);roundedRect.CloseFigure();return roundedRect; } 2、绘制阴影 internal void DrawShadow() {Bitmap bitmap null;Graphics g null;try{bitmap new Bitmap(Width, Height);g Graphics.FromImage(bitmap);g.SmoothingMode SmoothingMode.AntiAlias;Color c Color.FromArgb(0, 0, 0, 0);Pen p new Pen(c, 3);for (int i 0; i Main.ShadowWidth; i){p.Color Color.FromArgb((255 / 10 / Main.ShadowWidth) * i, c);DrawRoundRectangle(g, p, new Rectangle(i, i, Width - (2 * i) - 1, Height - (2 * i) - 1), Main.ShadowWidth - i);}SetBits(bitmap);}catch { }finally{g?.Dispose();bitmap?.Dispose();} } 3、绘制半透明bitmap到窗口上 protected override CreateParams CreateParams {get{CreateParams cParms base.CreateParams;cParms.ExStyle | 0x00080000; // WS_EX_LAYEREDreturn cParms;} } public void SetBits(Bitmap bitmap) {if (!Image.IsCanonicalPixelFormat(bitmap.PixelFormat) || !Image.IsAlphaPixelFormat(bitmap.PixelFormat))throw new ApplicationException(图片必须是32位带Alhpa通道的图片。);IntPtr oldBits IntPtr.Zero;IntPtr screenDC FormStyleAPI.GetDC(IntPtr.Zero);IntPtr hBitmap IntPtr.Zero;IntPtr memDc FormStyleAPI.CreateCompatibleDC(screenDC);try{FormStyleAPI.Point topLoc new FormStyleAPI.Point(Left, Top);FormStyleAPI.Size bitMapSize new FormStyleAPI.Size(Width, Height);FormStyleAPI.BLENDFUNCTION blendFunc new FormStyleAPI.BLENDFUNCTION();FormStyleAPI.Point srcLoc new FormStyleAPI.Point(0, 0);hBitmap bitmap.GetHbitmap(Color.FromArgb(0));oldBits FormStyleAPI.SelectObject(memDc, hBitmap);blendFunc.BlendOp FormStyleAPI.AC_SRC_OVER;blendFunc.SourceConstantAlpha Byte.Parse(((int)(Main.Opacity * 255)).ToString());blendFunc.AlphaFormat FormStyleAPI.AC_SRC_ALPHA;blendFunc.BlendFlags 0;FormStyleAPI.UpdateLayeredWindow(Handle, screenDC, ref topLoc, ref bitMapSize, memDc, ref srcLoc, 0, ref blendFunc, FormStyleAPI.ULW_ALPHA);}finally{if (hBitmap ! IntPtr.Zero){FormStyleAPI.SelectObject(memDc, oldBits);FormStyleAPI.DeleteObject(hBitmap);}FormStyleAPI.ReleaseDC(IntPtr.Zero, screenDC);FormStyleAPI.DeleteDC(memDc);} } 四、最终方案的效果和源码 源码下载
http://www.pierceye.com/news/907554/

相关文章:

  • 网站开发资质网站域名服务错误
  • html5 社团网站模板 代码下载上海做营销网站哪个公司好
  • 动易网站 模板南京企业建站系统模板
  • 网站实名网站建设技术百科
  • 网站策划书范文模板网盟推广费
  • 先做网站还是先做app唐山模板建站定制网站
  • 小城镇建设的网站中的主要观点廊坊网站设计公司
  • 银联支付网站建设企业qq登录
  • dw怎样做网站链接aspcms建站
  • 网站的栏目wordpress php版本太低
  • 浙江网站制作出效果图
  • 电子商务是电商吗产品seo是什么意思
  • 黑龙江省建设工程质量协会网站中文搜索引擎网站
  • 汽车报价网站宁波网络推广丿易企网怎么样
  • php个人网站简洁手机下载视频网站模板
  • 双语网站方法wordpress分类内没有文章
  • 做网站后期为什么续费仿uehtml WordPress
  • 网站实时显示wordpress 网站
  • 重庆电子网站建设ashx做网站
  • 河南双师培训网站html 路径 网站根路径
  • 专业定制网站企业如何注册公司营业执照
  • 福泉市自己的网站某个产品营销推广方案
  • 金坛市建设局网站微信网站有什么作用
  • 设计建网站今天的最新消息新闻
  • 电商行业建设网站ui网页设计培训学校
  • fineui 如何做网站私密浏览器免费版片视频动漫
  • 产地证是在哪个网站上做一起做网店下载安装
  • 舞钢市城乡建设局网站阿里巴巴网站谁做的
  • 巴彦淖尔市网站制作网站不收录怎么解决
  • 站群源码长春建设网站公司哪家好