[英]Color.FromArgb(…); security message
I am defining a Color from argb , ex 我正在定义一个来自argb的颜色,例如
Color.FromArgb(255,255,0,0);
In visual studio 2012 , winRT application it says that this is tagged with [security critical] . 在visual studio 2012中,winRT应用程序表示它被标记为[security critical]。 Are there any reasons why? 有什么理由吗? I tried searching, no results. 我试过搜索,没有结果。 And no idea why this relates to security. 并且不知道为什么这与安全性有关。
Update: 更新:
Now I notice, not only does FromArgb(...); 现在我注意到,不仅FromArgb(...); methods gives this [SECURITY CRITICAL] warning. 方法给出了[SECURITY CRITICAL]警告。 any of these: 任何这些:
c.A = 255;
c.R = 255;
c.G = 0;
c.B = 0;
Also does. 也是。
System.Drawing is a wrapper around unmanaged GDI+ code. System.Drawing是非托管GDI +代码的包装器。 From my understanding, WinRT does not support GDI+: 根据我的理解,WinRT不支持GDI +:
http://social.msdn.microsoft.com/Forums/en-NZ/winappswithnativecode/thread/0ba00fbd-183f-4df6-afa2-04d0ac14706a http://social.msdn.microsoft.com/Forums/en-NZ/winappswithnativecode/thread/0ba00fbd-183f-4df6-afa2-04d0ac14706a
Native rendering code will need to be done with Direct2D. 需要使用Direct2D完成本机渲染代码。
Your message is not a Warning , is information about method signature attribute. 您的消息不是警告 ,是有关方法签名属性的信息。
SECURITY CRITICAL is a code Attribute wich real class name is SecurityCriticalAttribute. SECURITY CRITICAL是一个代码属性,其真正的类名是SecurityCriticalAttribute。 This attribute must be given to methods thats need full trust to execute code ( usually native code calls, unsafe code, graphics resources (wich usually needs unmanaged code etc.) ). 必须将此属性赋予需要完全信任才能执行代码的方法(通常是本机代码调用,不安全代码,图形资源(通常需要非托管代码等))。
If methods are not granted full trust the Security Critical method raise an exception. 如果未授予方法完全信任,则安全关键方法会引发异常。
more info: http://msdn.microsoft.com/en-us/library/system.security.securitycriticalattribute.aspx 更多信息: http : //msdn.microsoft.com/en-us/library/system.security.securitycriticalattribute.aspx
您应该使用System.Windows.Media
的Color
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.