本文整理汇总了C++中BView::StrokeEllipse方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::StrokeEllipse方法的具体用法?C++ BView::StrokeEllipse怎么用?C++ BView::StrokeEllipse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BView
的用法示例。
在下文中一共展示了BView::StrokeEllipse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawThumb
void APPosSlider::DrawThumb(void)
{
BRect rect;
BView *view;
// Get the frame rectangle of the thumb
// and the offscreen view
rect = ThumbFrame();
view = OffscreenView();
// Draw the black shadow
view->SetDrawingMode(B_OP_ALPHA);
rgb_color c = BeDarkShadow;
c.alpha = 128;
view->SetHighColor(c);
rect.top++;
rect.left++;
view->FillEllipse(rect);
// Fill the inside of the thumb
view->SetDrawingMode(B_OP_COPY);
view->SetHighColor(BeButtonGrey);
rect.OffsetBy(-1, -1);
view->FillEllipse(rect);
// Draw the dark grey edge
view->SetHighColor(86, 86, 86, 255); // TODO : use an Haiku define to get that ?
view->SetPenSize(1.2);
view->StrokeEllipse(rect);
}
示例2: DrawFocusMark
void APPosSlider::DrawFocusMark(void)
{
BRect rect;
BView *view;
rgb_color color;
if (IsFocus())
{
// Get the frame rectangle of the thumb
// and the offscreen view
rect = ThumbFrame();
view = OffscreenView();
// Get the color to use
color = keyboard_navigation_color();
view->SetHighColor(color);
// Draw a circle inside the thumb
rect.InsetBy(2.0f, 2.0f);
view->StrokeEllipse(rect);
}
}
示例3: reply
//.........这里部分代码省略.........
{
BPoint points[4];
if (message.ReadList(points, 4) != B_OK)
continue;
BRect bounds = _BuildInvalidateRect(points, 4);
if (code == RP_STROKE_BEZIER) {
offscreen->StrokeBezier(points, pattern);
bounds.InsetBy(-penSize, -penSize);
} else if (code == RP_FILL_BEZIER)
offscreen->FillBezier(points, pattern);
else {
BGradient *gradient;
if (message.ReadGradient(&gradient) != B_OK)
continue;
offscreen->FillBezier(points, *gradient);
delete gradient;
}
invalidRegion.Include(bounds);
break;
}
case RP_STROKE_ELLIPSE:
case RP_FILL_ELLIPSE:
case RP_FILL_ELLIPSE_GRADIENT:
{
BRect rect;
if (message.Read(rect) != B_OK)
continue;
if (code == RP_STROKE_ELLIPSE) {
offscreen->StrokeEllipse(rect, pattern);
rect.InsetBy(-penSize, -penSize);
} else if (code == RP_FILL_ELLIPSE)
offscreen->FillEllipse(rect, pattern);
else {
BGradient *gradient;
if (message.ReadGradient(&gradient) != B_OK)
continue;
offscreen->FillEllipse(rect, *gradient);
delete gradient;
}
invalidRegion.Include(rect);
break;
}
case RP_STROKE_POLYGON:
case RP_FILL_POLYGON:
case RP_FILL_POLYGON_GRADIENT:
{
BRect bounds;
bool closed;
int32 numPoints;
message.Read(bounds);
message.Read(closed);
if (message.Read(numPoints) != B_OK)
continue;
BPoint points[numPoints];
for (int32 i = 0; i < numPoints; i++)
message.Read(points[i]);
示例4: AttribView
AttribEllipse::AttribEllipse ()
: AttribView (BRect (0, 0, 148, 90), lstring (34, "Ellipses"))
{
SetViewColor (LightGrey);
lSlid = new Slider (BRect (8, 8, 140, 26), 60, lstring (310, "Pen Size"), 1, 50, 1, new BMessage ('ALpc'));
AddChild (lSlid);
fType = ELLIPSE_OUTFILL;
fPenSize = 1;
BBox *type = new BBox (BRect (18, 32, 130, 82), "type");
type->SetLabel (lstring (311, "Type"));
AddChild (type);
BRect shape = BRect (3, 7, 27, 23);
BWindow *picWindow = new BWindow (BRect (0, 0, 100, 100), "Temp Pic Window", B_BORDERED_WINDOW, uint32 (NULL), uint32 (NULL));
BView *bg = new BView (BRect (0, 0, 100, 100), "Temp Pic View", uint32 (NULL), uint32 (NULL));
picWindow->AddChild (bg);
BPicture *p10;
bg->BeginPicture (new BPicture);
bg->SetLowColor (LightGrey);
bg->FillRect (BRect (0, 0, 32, 32), B_SOLID_LOW);
bg->SetLowColor (White);
bg->FillEllipse (shape, B_SOLID_LOW);
bg->StrokeEllipse (shape);
p10 = bg->EndPicture();
BPicture *p20;
bg->BeginPicture (new BPicture);
bg->SetLowColor (LightGrey);
bg->FillRect (BRect (0, 0, 32, 32), B_SOLID_LOW);
bg->SetHighColor (Black);
bg->SetLowColor (White);
bg->FillEllipse (shape, B_SOLID_LOW);
p20 = bg->EndPicture();
BPicture *p30;
bg->BeginPicture (new BPicture);
bg->SetLowColor (LightGrey);
bg->FillRect (BRect (0, 0, 32, 32), B_SOLID_LOW);
bg->SetHighColor (Black);
bg->SetLowColor (White);
bg->StrokeEllipse (shape);
p30 = bg->EndPicture();
BPicture *p11;
bg->BeginPicture (new BPicture);
bg->SetLowColor (DarkGrey);
bg->FillRect (BRect (0, 0, 32, 32), B_SOLID_LOW);
bg->SetHighColor (Black);
bg->SetLowColor (White);
bg->FillEllipse (shape, B_SOLID_LOW);
bg->StrokeEllipse (shape);
p11 = bg->EndPicture();
BPicture *p21;
bg->BeginPicture (new BPicture);
bg->SetLowColor (DarkGrey);
bg->FillRect (BRect (0, 0, 32, 32), B_SOLID_LOW);
bg->SetHighColor (Black);
bg->SetLowColor (White);
bg->FillEllipse (shape, B_SOLID_LOW);
p21 = bg->EndPicture();
BPicture *p31;
bg->BeginPicture (new BPicture);
bg->SetLowColor (DarkGrey);
bg->FillRect (BRect (0, 0, 32, 32), B_SOLID_LOW);
bg->SetHighColor (Black);
bg->SetLowColor (White);
bg->StrokeEllipse (shape);
p31 = bg->EndPicture();
SetViewColor (LightGrey);
delete picWindow;
pT1 = new BPictureButton (BRect (4, 15, 34, 45), "APVt1", p10, p11, new BMessage ('pvT1'), B_TWO_STATE_BUTTON);
pT2 = new BPictureButton (BRect (40, 15, 70, 45), "APVt2", p20, p21, new BMessage ('pvT2'), B_TWO_STATE_BUTTON);
pT3 = new BPictureButton (BRect (76, 15, 106, 45), "APVt3", p30, p31, new BMessage ('pvT3'), B_TWO_STATE_BUTTON);
type->AddChild (pT1);
type->AddChild (pT2);
type->AddChild (pT3);
pT1->SetValue (B_CONTROL_ON);
fCurrentProperty = 0;
}