本文整理汇总了C#中Format.id方法的典型用法代码示例。如果您正苦于以下问题:C# Format.id方法的具体用法?C# Format.id怎么用?C# Format.id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format.id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Picture
// render opcode 4 - create picture
/**
* @see <a href="XRenderCreatePicture.html">XRenderCreatePicture</a>
* @see Render#create_picture(Drawable, Picture.Format,
* Picture.Attributes)
*/
public Picture(Render render, Drawable drawable, Format format,
Attributes attr)
: base(render.display)
{
this.render = render;
Request request = new Request (display, render.major_opcode, 4,
5+attr.count ());
request.write4 (id);
request.write4 (drawable.id);
request.write4 (format.id ());
request.write4 (attr.bitmask);
attr.write (request);
display.send_request (request);
}
示例2: match
public bool match(Format template)
{
if ((template.bitmask & ID_BIT) != 0
&& template.id () != id ()) return false;
if ((template.bitmask & TYPE_BIT) != 0
&& template.type () != type ()) return false;
if ((template.bitmask & DEPTH_BIT) != 0
&& template.depth () != depth ()) return false;
if ((template.bitmask & COLORMAP_BIT) != 0
&& template.colormap_id () != colormap_id ()) return false;
Direct df0 = direct_format ();
Direct df1 = template.direct_format ();
if ((df1.bitmask & RED_BIT) != 0
&& df0.red () != df1.red ()) return false;
if ((df1.bitmask & RED_MASK_BIT) != 0
&& df0.red_mask () != df1.red_mask ()) return false;
if ((df1.bitmask & GREEN_BIT) != 0
&& df0.green () != df1.green ()) return false;
if ((df1.bitmask & GREEN_MASK_BIT) != 0 &&
df0.green_mask () != df1.green_mask ()) return false;
if ((df1.bitmask & BLUE_BIT) != 0 &&
df0.blue () != df1.blue ()) return false;
if ((df1.bitmask & BLUE_MASK_BIT) != 0 &&
df0.blue_mask () != df1.blue_mask ()) return false;
if ((df1.bitmask & ALPHA_BIT) != 0 &&
df0.alpha () != df1.alpha ()) return false;
if ((df1.bitmask & ALPHA_MASK_BIT) != 0 &&
df0.alpha_mask () != df1.alpha_mask ()) return false;
return true;
}