• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RGBA_Bytes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中RGBA_Bytes的典型用法代码示例。如果您正苦于以下问题:C# RGBA_Bytes类的具体用法?C# RGBA_Bytes怎么用?C# RGBA_Bytes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RGBA_Bytes类属于命名空间,在下文中一共展示了RGBA_Bytes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OpenMenuContents

		internal OpenMenuContents(ObservableCollection<MenuItem> MenuItems, GuiWidget widgetRelativeTo, Vector2 openOffset, Direction direction, RGBA_Bytes backgroundColor, RGBA_Bytes borderColor, int borderWidth, double maxHeight, bool alignToRightEdge)
		{
			this.MenuItems = new List<MenuItem>();
			this.MenuItems.AddRange(MenuItems);
			this.alignToRightEdge = alignToRightEdge;
			this.openOffset = openOffset;
			this.borderWidth = borderWidth;
			this.borderColor = borderColor;
			this.BackgroundColor = backgroundColor;

			this.direction = direction;
			this.widgetRelativeTo = widgetRelativeTo;
			scrollingWindow = new ScrollableWidget(true);
			{
				FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
				foreach (MenuItem menu in MenuItems)
				{
					menu.ClearRemovedFlag();
					topToBottom.AddChild(menu);
					menu.DoClickFunction = AllowClickingItems;
				}

				topToBottom.HAnchor = UI.HAnchor.ParentLeft | UI.HAnchor.FitToChildren;
				topToBottom.VAnchor = UI.VAnchor.ParentBottom;
				Width = topToBottom.Width;
				Height = topToBottom.Height;

				scrollingWindow.AddChild(topToBottom);
			}

			scrollingWindow.HAnchor = HAnchor.ParentLeftRight;
			scrollingWindow.VAnchor = VAnchor.ParentBottomTop;
			if (maxHeight > 0 && Height > maxHeight)
			{
				MakeMenuHaveScroll(maxHeight);
			}
			AddChild(scrollingWindow);

			LostFocus += new EventHandler(DropListItems_LostFocus);

			GuiWidget topParent = widgetRelativeTo.Parent;
			while (topParent.Parent != null)
			{
				// Regretably we don't know who it is that is the window that will actually think it is moving relative to its parent
				// but we need to know anytime our widgetRelativeTo has been moved by any change, so we hook them all.

				if (!widgetRefList.Contains(topParent))
				{
					widgetRefList.Add(topParent);
					topParent.PositionChanged += new EventHandler(widgetRelativeTo_PositionChanged);
					topParent.BoundsChanged += new EventHandler(widgetRelativeTo_PositionChanged);
				}

				topParent = topParent.Parent;
			}
			topParent.AddChild(this);

			widgetRelativeTo_PositionChanged(widgetRelativeTo, null);
			widgetRelativeTo.Closed += widgetRelativeTo_Closed;
		}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:60,代码来源:OpenMenuContents.cs


示例2: TextWidget

		public TextWidget(string text, double x = 0, double y = 0, double pointSize = 12, Justification justification = Justification.Left, RGBA_Bytes textColor = new RGBA_Bytes(), bool ellipsisIfClipped = true, bool underline = false, RGBA_Bytes backgroundColor = new RGBA_Bytes())
		{
			pointSize *= GlobalPointSizeScaleRatio;
			Selectable = false;
			DoubleBuffer = DoubleBufferDefault;
			AutoExpandBoundsToText = false;
			EllipsisIfClipped = ellipsisIfClipped;
			OriginRelativeParent = new Vector2(x, y);
			this.textColor = textColor;
			if (this.textColor.Alpha0To255 == 0)
			{
				// we assume it is the default if alpha 0.  Also there is no reason to make a text color of this as it will draw nothing.
				this.textColor = RGBA_Bytes.Black;
			}
			if (backgroundColor.Alpha0To255 != 0)
			{
				BackgroundColor = backgroundColor;
			}

			base.Text = text;
			StyledTypeFace typeFaceStyle = new StyledTypeFace(LiberationSansFont.Instance, pointSize, underline);
			printer = new TypeFacePrinter(text, typeFaceStyle, justification: justification);

			LocalBounds = printer.LocalBounds;

			MinimumSize = new Vector2(LocalBounds.Width, LocalBounds.Height);
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:27,代码来源:TextWidget.cs


示例3: BlendSolidVerticalSpan

        //--------------------------------------------------------------------
        public unsafe override void BlendSolidVerticalSpan(int x, int y,
										  uint len,
										  RGBA_Bytes c,
										  byte* covers)
        {
            PixelFormat.BlendSolidHorizontalSpan(y, x, len, c, covers);
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:8,代码来源:Transposer.cs


示例4: TestGetHashCode

		public void TestGetHashCode()
		{
			{
				RGBA_Bytes a = new RGBA_Bytes(10, 11, 12);
				RGBA_Bytes b = new RGBA_Bytes(10, 11, 12);
				Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
			}
			{
				RGBA_Floats a = new RGBA_Floats(10, 11, 12);
				RGBA_Floats b = new RGBA_Floats(10, 11, 12);
				Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
			}
			{
				BorderDouble a = new BorderDouble(10, 11, 12, 13);
				BorderDouble b = new BorderDouble(10, 11, 12, 13);
				Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
			}
			{
				Point2D a = new Point2D(10, 11);
				Point2D b = new Point2D(10, 11);
				Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
			}
			{
				RectangleDouble a = new RectangleDouble(10, 11, 12, 13);
				RectangleDouble b = new RectangleDouble(10, 11, 12, 13);
				Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
			}
			{
				RectangleInt a = new RectangleInt(10, 11, 12, 13);
				RectangleInt b = new RectangleInt(10, 11, 12, 13);
				Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
			}
		}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:33,代码来源:SimpleTests.cs


示例5: CopyPixels

		public void CopyPixels(byte[] buffer, int bufferOffset, RGBA_Bytes sourceColor, int count)
		{
			do
			{
				buffer[bufferOffset++] = sourceColor.red;
			}
			while (--count != 0);
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:8,代码来源:BGRA32LcdSubPixelBlender.cs


示例6: span_gouraud_rgba

        public span_gouraud_rgba(RGBA_Bytes c1,
						  RGBA_Bytes c2,
						  RGBA_Bytes c3,
						  double x1, double y1,
						  double x2, double y2,
						  double x3, double y3)
            : this(c1, c2, c3, x1, y1, x2, y2, x3, y3, 0)
        {
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:9,代码来源:GouraudSpanRGBA.cs


示例7: AddText

		private void AddText(string tabText, GuiWidget widgetState, RGBA_Bytes textColor, RGBA_Bytes backgroundColor, double pointSize)
		{
			tabTitle = new TextWidget(tabText, pointSize: pointSize, textColor: textColor);
			tabTitle.AutoExpandBoundsToText = true;
			widgetState.AddChild(tabTitle);
			widgetState.Selectable = false;
			widgetState.SetBoundsToEncloseChildren();
			widgetState.BackgroundColor = backgroundColor;
		}
开发者ID:SkightTeam,项目名称:agg-sharp,代码行数:9,代码来源:Tab.cs


示例8: RadioButtonViewText

		public RadioButtonViewText(string label)
		{
			labelTextWidget = new TextWidget(label, 12);
			AddChild(labelTextWidget);

			LocalBounds = GetLocalBounds();

			inactiveColor = new RGBA_Bytes(0.0, 0.0, 0.0);
			activeColor = new RGBA_Bytes(0.4, 0.0, 0.0);
		}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:10,代码来源:RadioButtonViewText.cs


示例9: BlendPixel

		public void BlendPixel(byte[] pDestBuffer, int bufferOffset, RGBA_Bytes sourceColor)
		{
			int OneOverAlpha = base_mask - sourceColor.alpha;
			unchecked
			{
				int y = (sourceColor.red * 77) + (sourceColor.green * 151) + (sourceColor.blue * 28);
				int gray = (y >> 8);
				gray = (byte)((((gray - (int)(pDestBuffer[bufferOffset])) * sourceColor.alpha) + ((int)(pDestBuffer[bufferOffset]) << base_shift)) >> base_shift);
				pDestBuffer[bufferOffset] = (byte)gray;
			}
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:11,代码来源:Gray.cs


示例10: CopyPixels

		public void CopyPixels(byte[] pDestBuffer, int bufferOffset, RGBA_Bytes sourceColor, int count)
		{
			do
			{
				int y = (sourceColor.red * 77) + (sourceColor.green * 151) + (sourceColor.blue * 28);
				int gray = (y >> 8);
				pDestBuffer[bufferOffset] = (byte)gray;
				bufferOffset += bytesBetweenPixelsInclusive;
			}
			while (--count != 0);
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:11,代码来源:Gray.cs


示例11: createState

		private GuiWidget createState(string word, double width, double height, ref RGBA_Bytes backgroundColor, ref RGBA_Bytes interiorColor, ref RGBA_Bytes thumbColor, ref RGBA_Bytes textColor)
		{

			TextWidget text = new TextWidget(word, pointSize: 10, textColor: textColor);
			text.VAnchor = VAnchor.ParentCenter;
			SwitchView switchGraphics = new SwitchView(width, height, word == onText, backgroundColor, interiorColor, thumbColor, textColor);
			switchGraphics.VAnchor = VAnchor.ParentCenter;
			switchGraphics.Margin = new BorderDouble(5, 0, 0, 0);
			GuiWidget switchNormalToPressed = new FlowLayoutWidget(FlowDirection.LeftToRight, text, switchGraphics);
			return switchNormalToPressed;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:11,代码来源:ToggleSwitch.cs


示例12: span_gouraud

        //--------------------------------------------------------------------
        public span_gouraud(RGBA_Bytes c1,
					 RGBA_Bytes c2,
					 RGBA_Bytes c3,
					 double x1, double y1,
					 double x2, double y2,
					 double x3, double y3,
					 double d)
        {
            m_vertex = (0);
            colors(c1, c2, c3);
            triangle(x1, y1, x2, y2, x3, y3, d);
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:13,代码来源:GouraudSpan.cs


示例13: SwitchView

			internal SwitchView(double width, double height, bool startValue, 
				RGBA_Bytes backgroundColor, RGBA_Bytes interiorColor, RGBA_Bytes thumbColor, RGBA_Bytes exteriorColor)
			{
				this.startValue = startValue;
				switchWidth = width;
				switchHeight = height;
				thumbHeight = height;
				thumbWidth = width / 4;
				InteriorColor = interiorColor;
				ExteriorColor = exteriorColor;
				ThumbColor = thumbColor;
				LocalBounds = new RectangleDouble(0, 0, width, height);
			}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:13,代码来源:ToggleSwitch.cs


示例14: DynamicDropDownMenu

		public DynamicDropDownMenu(GuiWidget buttonView, Direction direction = Direction.Down, double pointSize = 12)
			: base(buttonView, direction, pointSize)
		{
			menuItems = new TupleList<string, Func<bool>>();
			TextColor = RGBA_Bytes.Black;
			NormalArrowColor = RGBA_Bytes.Black;
			HoverArrowColor = RGBA_Bytes.Black;

			BorderWidth = 1;
			BorderColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 200);

			this.SelectionChanged += new EventHandler(AltChoices_SelectionChanged);
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:13,代码来源:DynamicDropDownMenu.cs


示例15: SimpleTextTabWidget

		public SimpleTextTabWidget(TabPage tabPageControledByTab, string internalTabName, double pointSize,
			RGBA_Bytes selectedTextColor, RGBA_Bytes selectedBackgroundColor,
			RGBA_Bytes normalTextColor, RGBA_Bytes normalBackgroundColor)
			: base(internalTabName, new GuiWidget(), new GuiWidget(), new GuiWidget(), tabPageControledByTab)
		{
			AddText(tabPageControledByTab.Text, selectedWidget, selectedTextColor, selectedBackgroundColor, pointSize);
			AddText(tabPageControledByTab.Text, normalWidget, normalTextColor, normalBackgroundColor, pointSize);
			//hoverWidget;

			tabPageControledByTab.TextChanged += new EventHandler(tabPageControledByTab_TextChanged);

			SetBoundsToEncloseChildren();
		}
开发者ID:SkightTeam,项目名称:agg-sharp,代码行数:13,代码来源:Tab.cs


示例16: ToggleSwitchView

		public ToggleSwitchView(string onText, string offText, double width, double height,
			RGBA_Bytes backgroundColor, RGBA_Bytes interiorColor, RGBA_Bytes thumbColor, RGBA_Bytes textColor)
		{
			this.onText = onText;
			GuiWidget normal = createState(offText, width, height, ref backgroundColor, ref interiorColor, ref thumbColor, ref textColor);
			GuiWidget normalHover = createState(offText, width, height, ref backgroundColor, ref interiorColor, ref thumbColor, ref textColor);
			GuiWidget switchNormalToPressed = createState(onText, width, height, ref backgroundColor, ref interiorColor, ref thumbColor, ref textColor);
			GuiWidget pressed = createState(onText, width, height, ref backgroundColor, ref interiorColor, ref thumbColor, ref textColor);
			GuiWidget pressedHover = createState(onText, width, height, ref backgroundColor, ref interiorColor, ref thumbColor, ref textColor);
			GuiWidget switchPressedToNormal = createState(offText, width, height, ref backgroundColor, ref interiorColor, ref thumbColor, ref textColor);
			GuiWidget disabled = new TextWidget("disabled");
			SetViewStates(normal, normalHover, switchNormalToPressed, pressed, pressedHover, switchPressedToNormal, disabled);
			this.VAnchor = VAnchor.FitToChildren;
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:14,代码来源:ToggleSwitch.cs


示例17: MessageBox

        public MessageBox(String message, string windowTitle, MessageType messageType, double width, double height)
            : base(width, height)
        {
            BackgroundColor = new RGBA_Bytes(50, 50, 50, 240);
            FlowLayoutWidget topToBottomFlow = new FlowLayoutWidget(FlowDirection.TopToBottom);
            topToBottomFlow.HAnchor = Agg.UI.HAnchor.ParentCenter;
            topToBottomFlow.VAnchor = Agg.UI.VAnchor.ParentCenter;
            topToBottomFlow.AddChild(new TextWidget(message, textColor: RGBA_Bytes.White));

            Title = windowTitle;

            // add a spacer
            topToBottomFlow.AddChild(new GuiWidget(10, 10));

            switch (messageType)
            {
                case MessageType.YES_NO:
                    {
                        FlowLayoutWidget yesNoButtonsFlow = new FlowLayoutWidget();

                        Button yesButton = new Button("Yes");
                        yesButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click);
                        yesNoButtonsFlow.AddChild(yesButton);

                        Button noButton = new Button("No");
                        noButton.Click += new ButtonBase.ButtonEventHandler(noButton_Click);
                        yesNoButtonsFlow.AddChild(noButton);

                        topToBottomFlow.AddChild(yesNoButtonsFlow);
                    }
                    break;

                case MessageType.OK:
                    {
                        Button okButton = new Button("Ok");
                        okButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click);
                        topToBottomFlow.AddChild(okButton);
                    }
                    break;

                default:
                    throw new NotImplementedException();
            }

            topToBottomFlow.SetBoundsToEncloseChildren();

            AddChild(topToBottomFlow);

            IsModal = true;
        }
开发者ID:jeske,项目名称:agg-sharp,代码行数:50,代码来源:MessageBox.cs


示例18: PixelHighResolution

        public unsafe void PixelHighResolution(RasterBuffer buf, RGBA_Bytes* p, int x, int y)
        {
            int r, g, b, a;
            r = g = b = a = LineAABasics.line_subpixel_scale * LineAABasics.line_subpixel_scale / 2;

            int weight;
            int x_lr = x >> LineAABasics.line_subpixel_shift;
            int y_lr = y >> LineAABasics.line_subpixel_shift;

            x &= LineAABasics.line_subpixel_mask;
            y &= LineAABasics.line_subpixel_mask;
            RGBA_Bytes* ptr = (RGBA_Bytes*)buf.GetPixelPointer(x_lr, y_lr);

            weight = (LineAABasics.line_subpixel_scale - x) *
                     (LineAABasics.line_subpixel_scale - y);
            r += weight * ptr->m_R;
            g += weight * ptr->m_G;
            b += weight * ptr->m_B;
            a += weight * ptr->m_A;

            ++ptr;

            weight = x * (LineAABasics.line_subpixel_scale - y);
            r += weight * ptr->m_R;
            g += weight * ptr->m_G;
            b += weight * ptr->m_B;
            a += weight * ptr->m_A;

            ptr = (RGBA_Bytes*)buf.GetPixelPointer(x_lr, y_lr + 1);

            weight = (LineAABasics.line_subpixel_scale - x) * y;
            r += weight * ptr->m_R;
            g += weight * ptr->m_G;
            b += weight * ptr->m_B;
            a += weight * ptr->m_A;

            ++ptr;

            weight = x * y;
            r += weight * ptr->m_R;
            g += weight * ptr->m_G;
            b += weight * ptr->m_B;
            a += weight * ptr->m_A;

            p->m_R = (byte)(r >> LineAABasics.line_subpixel_shift * 2);
            p->m_G = (byte)(g >> LineAABasics.line_subpixel_shift * 2);
            p->m_B = (byte)(b >> LineAABasics.line_subpixel_shift * 2);
            p->m_A = (byte)(a >> LineAABasics.line_subpixel_shift * 2);
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:49,代码来源:PatternFiltersRGBA.cs


示例19: BlendPixels

		public void BlendPixels(byte[] destBuffer, int bufferOffset,
			RGBA_Bytes[] sourceColors, int sourceColorsOffset,
			byte[] covers, int coversIndex, bool firstCoverForAll, int count)
		{
			if (firstCoverForAll)
			{
				int cover = covers[coversIndex];
				if (cover == 255)
				{
					do
					{
						BlendPixel(destBuffer, bufferOffset, sourceColors[sourceColorsOffset++]);
						bufferOffset += bytesBetweenPixelsInclusive;
					}
					while (--count != 0);
				}
				else
				{
					do
					{
						sourceColors[sourceColorsOffset].alpha = (byte)((sourceColors[sourceColorsOffset].alpha * cover + 255) >> 8);
						BlendPixel(destBuffer, bufferOffset, sourceColors[sourceColorsOffset]);
						bufferOffset += bytesBetweenPixelsInclusive;
						++sourceColorsOffset;
					}
					while (--count != 0);
				}
			}
			else
			{
				do
				{
					int cover = covers[coversIndex++];
					if (cover == 255)
					{
						BlendPixel(destBuffer, bufferOffset, sourceColors[sourceColorsOffset]);
					}
					else
					{
						RGBA_Bytes color = sourceColors[sourceColorsOffset];
						color.alpha = (byte)((color.alpha * (cover) + 255) >> 8);
						BlendPixel(destBuffer, bufferOffset, color);
					}
					bufferOffset += bytesBetweenPixelsInclusive;
					++sourceColorsOffset;
				}
				while (--count != 0);
			}
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:49,代码来源:Gray.cs


示例20: copy_hline

		public override void copy_hline(int x, int y, int len, RGBA_Bytes c)
		{
			throw new NotImplementedException();
			/*
						realloc_span((int)len);
						unsafe
						{
							fixed (byte* pBuffer = m_span.Array)
							{
								m_mask.fill_hspan(x, y, pBuffer, (int)len);
								m_LinkedImage.blend_solid_hspan(x, y, len, c, pBuffer);
							}
						}
			 */
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:15,代码来源:AlphaMaskAdaptor.cs



注:本文中的RGBA_Bytes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RHC类代码示例发布时间:2022-05-24
下一篇:
C# RGB类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap