本文整理汇总了C#中MatterHackers.Agg.RGBA_Bytes类的典型用法代码示例。如果您正苦于以下问题:C# RGBA_Bytes类的具体用法?C# RGBA_Bytes怎么用?C# RGBA_Bytes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RGBA_Bytes类属于MatterHackers.Agg命名空间,在下文中一共展示了RGBA_Bytes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SliceSelectorWidget
private int presetIndex; //For multiple materials
public SliceSelectorWidget(string label, RGBA_Bytes accentColor, string tag = null, int presetIndex = 1)
: base(FlowDirection.TopToBottom)
{
this.presetIndex = presetIndex;
this.filterLabel = label;
if (tag == null)
{
this.filterTag = label.ToLower();
}
else
{
this.filterTag = tag;
}
this.HAnchor = HAnchor.ParentLeftRight;
this.VAnchor = Agg.UI.VAnchor.Max_FitToChildren_ParentHeight;
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
GuiWidget accentBar = new GuiWidget(7, 5);
accentBar.BackgroundColor = accentColor;
accentBar.HAnchor = HAnchor.ParentLeftRight;
TextWidget labelText = new TextWidget(LocalizedString.Get(label).ToUpper());
labelText.TextColor = ActiveTheme.Instance.PrimaryTextColor;
labelText.HAnchor = Agg.UI.HAnchor.ParentCenter;
labelText.Margin = new BorderDouble(0, 3, 0, 6);
this.AddChild(labelText);
this.AddChild(GetPulldownContainer());
this.AddChild(new VerticalSpacer());
this.AddChild(accentBar);
}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:35,代码来源:SettingsControlSelectors.cs
示例2: DrawTo
public static void DrawTo(Graphics2D graphics2D, Mesh meshToDraw, Vector2 offset, double scale, RGBA_Bytes silhouetteColor)
{
graphics2D.Rasterizer.gamma(new gamma_power(.3));
PathStorage polygonProjected = new PathStorage();
foreach (Face face in meshToDraw.Faces)
{
if (face.normal.z > 0)
{
polygonProjected.remove_all();
bool first = true;
foreach (FaceEdge faceEdge in face.FaceEdges())
{
Vector2 position = new Vector2(faceEdge.firstVertex.Position.x, faceEdge.firstVertex.Position.y);
position += offset;
position *= scale;
if (first)
{
polygonProjected.MoveTo(position.x, position.y);
first = false;
}
else
{
polygonProjected.LineTo(position.x, position.y);
}
}
graphics2D.Render(polygonProjected, silhouetteColor);
}
}
graphics2D.Rasterizer.gamma(new gamma_none());
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:30,代码来源:OrthographicZProjection.cs
示例3: HistoryData
internal HistoryData(int Capacity, IColorType Color)
{
m_Color = Color.GetAsRGBA_Bytes();
m_Capacity = Capacity;
m_Data = new TwoSidedStack<double>();
Reset();
}
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:7,代码来源:DataViewGraph.cs
示例4: HistoryData
internal HistoryData(int capacity, IColorType lineColor)
{
this.lineColor = lineColor.GetAsRGBA_Bytes();
this.capacity = capacity;
data = new List<double>();
Reset();
}
开发者ID:broettge,项目名称:MatterControl,代码行数:7,代码来源:DataViewGraph.cs
示例5: PresetSelectorWidget
private int extruderIndex; //For multiple materials
public PresetSelectorWidget(string label, RGBA_Bytes accentColor, string tag, int extruderIndex)
: base(FlowDirection.TopToBottom)
{
this.extruderIndex = extruderIndex;
this.filterLabel = label;
this.filterTag = (tag == null) ? label.ToLower() : tag;
this.HAnchor = HAnchor.ParentLeftRight;
this.VAnchor = Agg.UI.VAnchor.Max_FitToChildren_ParentHeight;
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
GuiWidget accentBar = new GuiWidget(7, 5)
{
BackgroundColor = accentColor,
HAnchor = HAnchor.ParentLeftRight
};
TextWidget labelText = new TextWidget(label.Localize().ToUpper())
{
TextColor = ActiveTheme.Instance.PrimaryTextColor,
HAnchor = Agg.UI.HAnchor.ParentCenter,
Margin = new BorderDouble(0, 3, 0, 6)
};
this.AddChild(labelText);
this.AddChild(GetPulldownContainer());
this.AddChild(new VerticalSpacer());
this.AddChild(accentBar);
}
开发者ID:broettge,项目名称:MatterControl,代码行数:31,代码来源:SettingsControlSelectors.cs
示例6: ControlButtonViewBase
public ControlButtonViewBase(string label,
double width,
double height,
double textHeight,
double borderWidth,
double borderRadius,
double padding,
RGBA_Bytes textColor,
RGBA_Bytes fillColor,
RGBA_Bytes borderColor)
: base(width, height)
{
this.borderRadius = borderRadius;
this.borderWidth = borderWidth;
this.fillColor = fillColor;
this.borderColor = borderColor;
this.padding = padding;
TextWidget buttonText = new TextWidget(label, textHeight);
buttonText.VAnchor = VAnchor.ParentCenter;
buttonText.HAnchor = HAnchor.ParentCenter;
buttonText.TextColor = textColor;
//this.AnchorAll();
this.AddChild(buttonText);
}
开发者ID:fuding,项目名称:MatterControl,代码行数:26,代码来源:ActionBarBaseControls.cs
示例7: SetDisplayAttributes
private void SetDisplayAttributes()
{
this.separatorLineColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 100);
this.Margin = new BorderDouble(2, 4, 2, 0);
// colors
this.textImageButtonFactory.normalFillColor = RGBA_Bytes.Transparent;
this.textImageButtonFactory.normalBorderColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 200);
this.textImageButtonFactory.normalTextColor = ActiveTheme.Instance.SecondaryTextColor;
this.textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor;
this.textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor;
this.textImageButtonFactory.hoverBorderColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 200);
this.textImageButtonFactory.disabledFillColor = RGBA_Bytes.Transparent;
this.textImageButtonFactory.disabledBorderColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 100);
this.textImageButtonFactory.disabledTextColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 100);
// other settings
this.textImageButtonFactory.FixedHeight = TallButtonHeight;
this.textImageButtonFactory.fontSize = 11;
this.textImageButtonFactory.borderWidth = 1;
this.linkButtonFactory.fontSize = 11;
}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:26,代码来源:SettingsViewBase.cs
示例8: ViewControls2D
public ViewControls2D()
{
if (ActiveTheme.Instance.DisplayMode == ActiveTheme.ApplicationDisplayType.Touchscreen)
{
buttonHeight = 40;
}
else
{
buttonHeight = 20;
}
TextImageButtonFactory iconTextImageButtonFactory = new TextImageButtonFactory();
iconTextImageButtonFactory.AllowThemeToAdjustImage = false;
iconTextImageButtonFactory.checkedBorderColor = RGBA_Bytes.White;
BackgroundColor = new RGBA_Bytes(0, 0, 0, 120);
iconTextImageButtonFactory.FixedHeight = buttonHeight;
iconTextImageButtonFactory.FixedWidth = buttonHeight;
string translateIconPath = Path.Combine("ViewTransformControls", "translate.png");
translateButton = iconTextImageButtonFactory.GenerateRadioButton("", translateIconPath);
translateButton.Margin = new BorderDouble(3);
AddChild(translateButton);
string scaleIconPath = Path.Combine("ViewTransformControls", "scale.png");
scaleButton = iconTextImageButtonFactory.GenerateRadioButton("", scaleIconPath);
scaleButton.Margin = new BorderDouble(3);
AddChild(scaleButton);
Margin = new BorderDouble(5);
HAnchor |= Agg.UI.HAnchor.ParentLeft;
VAnchor = Agg.UI.VAnchor.ParentTop;
translateButton.Checked = true;
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:34,代码来源:ViewControls2D.cs
示例9: RenderSolidSingleScanLine
protected override void RenderSolidSingleScanLine(IImageByte destImage, IScanlineCache scanLineCache, RGBA_Bytes color)
{
int y = scanLineCache.y();
int num_spans = scanLineCache.num_spans();
ScanlineSpan scanlineSpan = scanLineCache.begin();
byte[] ManagedCoversArray = scanLineCache.GetCovers();
for (; ; )
{
int x = scanlineSpan.x;
int num_pix = scanlineSpan.len;
int coverIndex = scanlineSpan.cover_index;
do
{
int a = (ManagedCoversArray[coverIndex++] * color.Alpha0To255) >> 8;
m_square.draw(destImage.NewGraphics2D().Rasterizer, m_sl, destImage,
new RGBA_Bytes(color.Red0To255, color.Green0To255, color.Blue0To255, a),
x, y);
++x;
}
while (--num_pix > 0);
if (--num_spans == 0) break;
scanlineSpan = scanLineCache.GetNextScanlineSpan();
}
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:26,代码来源:aa_demo.cs
示例10: PanelSeparator
public PanelSeparator()
: base(4, 1)
{
AddHandlers();
defaultBackgroundColor = new RGBA_Bytes(200, 200, 200);
hoverBackgroundColor = new RGBA_Bytes(100, 100, 100);
Agg.Image.ImageBuffer arrowImage = new Agg.Image.ImageBuffer();
ImageIO.LoadImageData(Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "Icons", "icon_arrow_left_16x16.png"), arrowImage);
arrowIndicator = new ImageWidget(arrowImage);
arrowIndicator.HAnchor = Agg.UI.HAnchor.ParentCenter;
arrowIndicator.VAnchor = Agg.UI.VAnchor.ParentCenter;
arrowIndicator.Visible = true;
this.AddChild(arrowIndicator);
this.Hidden = false;
this.BackgroundColor = defaultBackgroundColor;
this.VAnchor = VAnchor.ParentBottomTop;
this.Margin = new BorderDouble(8, 0);
this.Cursor = Cursors.Hand;
SetDisplayState();
}
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:25,代码来源:PanelSeparator.cs
示例11: 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())
{
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:jeske,项目名称:agg-sharp,代码行数:26,代码来源:TextWidget.cs
示例12: CopyPixels
public void CopyPixels(byte[] buffer, int bufferOffset, RGBA_Bytes sourceColor, int count)
{
do
{
buffer[bufferOffset++] = sourceColor.red;
}
while (--count != 0);
}
开发者ID:jeske,项目名称:agg-sharp,代码行数:8,代码来源:BGRA32LcdSubPixelBlender.cs
示例13: CreateWhiteToColor
public static ImageBuffer CreateWhiteToColor(ImageBuffer normalImage, RGBA_Bytes color)
{
ImageBuffer destImage = new ImageBuffer(normalImage.Width, normalImage.Height, 32, new BlenderBGRA());
DoWhiteToColor(destImage, normalImage, color);
return destImage;
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:8,代码来源:WhiteToColor.cs
示例14: RenderFeatureExtrusion
public RenderFeatureExtrusion(Vector3 start, Vector3 end, int extruderIndex, double travelSpeed, double totalExtrusionMm, double filamentDiameterMm, double layerHeight, RGBA_Bytes color)
: base(start, end, extruderIndex, travelSpeed)
{
this.color = color;
double fillamentRadius = filamentDiameterMm / 2;
double areaSquareMm = (fillamentRadius * fillamentRadius) * Math.PI;
this.extrusionVolumeMm3 = (float)(areaSquareMm * totalExtrusionMm);
this.layerHeight = (float)layerHeight;
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:10,代码来源:RenderFeatureExtrusion.cs
示例15: HeightValueDisplay
public HeightValueDisplay(View3DWidget view3DWidget)
{
BackgroundColor = new RGBA_Bytes(RGBA_Bytes.White, 150);
this.view3DWidget = view3DWidget;
view3DWidget.meshViewerWidget.AddChild(this);
VAnchor = VAnchor.FitToChildren;
HAnchor = HAnchor.FitToChildren;
MeshViewerToDrawWith.DrawAfter += new DrawEventHandler(MeshViewerToDrawWith_Draw);
}
开发者ID:broettge,项目名称:MatterControl,代码行数:10,代码来源:HeightValueDisplay.cs
示例16: TextImageWidget
public TextImageWidget(string label, RGBA_Bytes fillColor, RGBA_Bytes borderColor, RGBA_Bytes textColor, double borderWidth, BorderDouble margin, ImageBuffer image = null, double fontSize = 12, FlowDirection flowDirection = FlowDirection.LeftToRight, double height = 40, double width = 0, bool centerText = false, double imageSpacing = 0)
: base()
{
this.image = image;
this.fillColor = fillColor;
this.borderColor = borderColor;
this.borderWidth = borderWidth;
this.Margin = new BorderDouble(0);
this.Padding = new BorderDouble(0);
TextWidget textWidget = new TextWidget(label, pointSize: fontSize);
ImageWidget imageWidget;
FlowLayoutWidget container = new FlowLayoutWidget(flowDirection);
if (centerText)
{
// make sure the contents are centered
GuiWidget leftSpace = new GuiWidget(0, 1);
leftSpace.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
container.AddChild(leftSpace);
}
if (image != null && image.Width > 0)
{
imageWidget = new ImageWidget(image);
imageWidget.VAnchor = VAnchor.ParentCenter;
imageWidget.Margin = new BorderDouble(right: imageSpacing);
container.AddChild(imageWidget);
}
if (label != "")
{
textWidget.VAnchor = VAnchor.ParentCenter;
textWidget.TextColor = textColor;
textWidget.Padding = new BorderDouble(3, 0);
container.AddChild(textWidget);
}
if (centerText)
{
GuiWidget rightSpace = new GuiWidget(0, 1);
rightSpace.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
container.AddChild(rightSpace);
container.HAnchor = Agg.UI.HAnchor.ParentLeftRight | Agg.UI.HAnchor.FitToChildren;
}
container.VAnchor = Agg.UI.VAnchor.ParentCenter;
container.MinimumSize = new Vector2(width, height);
container.Margin = margin;
this.AddChild(container);
HAnchor = HAnchor.ParentLeftRight | HAnchor.FitToChildren;
VAnchor = VAnchor.ParentCenter | Agg.UI.VAnchor.FitToChildren;
}
开发者ID:broettge,项目名称:MatterControl,代码行数:55,代码来源:TextImageButtonFactory.cs
示例17: RenderSolid
public void RenderSolid(IImageByte destImage, IRasterizer rasterizer, IScanlineCache scanLine, RGBA_Bytes color)
{
if (rasterizer.rewind_scanlines())
{
scanLine.reset(rasterizer.min_x(), rasterizer.max_x());
while (rasterizer.sweep_scanline(scanLine))
{
RenderSolidSingleScanLine(destImage, scanLine, color);
}
}
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:11,代码来源:ScanlineRenderer.cs
示例18: mesh_point
public mesh_point(double x_, double y_,
double dx_, double dy_,
RGBA_Bytes c, RGBA_Bytes dc_)
{
x = (x_);
y = (y_);
dx = (dx_);
dy = (dy_);
color = (c);
dc = (dc_);
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:11,代码来源:gouraud_mesh.cs
示例19: 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:jeske,项目名称:agg-sharp,代码行数:11,代码来源:Gray.cs
示例20: 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:jeske,项目名称:agg-sharp,代码行数:11,代码来源:Gray.cs
注:本文中的MatterHackers.Agg.RGBA_Bytes类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论