kretzschmar
asked on
qow 12: how to draw an egg on a canvas?
hi experts,
i am starting a new quest: qow = question of the week :-)
each week i will introduce a new simple? question.
now qow 12
(one week later, i was absend)
the first working solution will get the points (a graded).
sorry, top 15 experts, you are not allowed to solve this
q, only other can solve this question :-(
well the question is:
how to draw an egg on a canvas??
a little sample is needed
let see
meikl ;-)
i am starting a new quest: qow = question of the week :-)
each week i will introduce a new simple? question.
now qow 12
(one week later, i was absend)
the first working solution will get the points (a graded).
sorry, top 15 experts, you are not allowed to solve this
q, only other can solve this question :-(
well the question is:
how to draw an egg on a canvas??
a little sample is needed
let see
meikl ;-)
Whay not red ? :o)
er what do you feed your chickens? <G>
with form1.canvas do
begin
Brush.Color := clYellow;
Brush.Style := bsDiagCross;
Ellipse(0,0,210,350);
MoveTo(13,90);
Lineto(210,210);
MoveTo(6,120);
Lineto(206,240);
Brush.Color := clBlue;
Brush.Style := bsSolid;
FloodFill(14,94,ClBlack,fs Border);
Brush.Style := bsClear;
Font.Size:=12;
TextOut(220,0,'HAPPY EASTER!!');
end;
Good luck!!
begin
Brush.Color := clYellow;
Brush.Style := bsDiagCross;
Ellipse(0,0,210,350);
MoveTo(13,90);
Lineto(210,210);
MoveTo(6,120);
Lineto(206,240);
Brush.Color := clBlue;
Brush.Style := bsSolid;
FloodFill(14,94,ClBlack,fs
Brush.Style := bsClear;
Font.Size:=12;
TextOut(220,0,'HAPPY EASTER!!');
end;
Good luck!!
Hi,
he he he.... this is as simple as it gets
it's fun!
t.
procedure TForm1.EggButtonClick(Send er: TObject);
var
x,y:integer;
begin
x:=10; //Pos
y:=10; //Pos
image1. canvas.brush.color:=random (256*256*2 56);//colo r random
image1.canvas.ellipse(x,y, x+(200), y+(120)); //ellipse size
//Image1 = Transparent:=False
end;
end.
he he he.... this is as simple as it gets
it's fun!
t.
procedure TForm1.EggButtonClick(Send
var
x,y:integer;
begin
x:=10; //Pos
y:=10; //Pos
image1. canvas.brush.color:=random
image1.canvas.ellipse(x,y,
//Image1 = Transparent:=False
end;
end.
// __________________________ __________ __________ __________ __________ _______
procedure TForm1.eggTop(l,t,r,b: integer);
var
half: integer;
begin
half := t+(b-t) div 2;
form1.Canvas.Arc(l,t,r,b,l ,half,r,ha lf);
end;
// __________________________ __________ __________ __________ __________ _______
procedure TForm1.eggBottom(l,t,r,b: integer);
var
half: integer;
begin
half := t+(b-t) div 2;
form1.Canvas.Arc(l,t,r,b,r ,half,l,ha lf);
end;
// __________________________ __________ __________ __________ __________ _______
procedure TForm1.egg(l,t,r,b: integer; egginess: integer);
var
stretch: integer;
begin
stretch := (egginess*(b-t)) div 100;
EggTop(l,t+stretch,r,b);
EggBottom(l,t,r,b+stretch) ;
form1.Canvas.Brush.Color := clBlue;
form1.Canvas.FloodFill((r- l) div 2,(b-t) div 2,form1.Canvas.Pen.Color,f sBorder);
end;
// __________________________ __________ __________ __________ __________ _______
procedure TForm1.Button1Click(Sender : TObject);
begin
// Left, top, width, height, egginess
egg(50,50,300,400,20);
end;
procedure TForm1.eggTop(l,t,r,b: integer);
var
half: integer;
begin
half := t+(b-t) div 2;
form1.Canvas.Arc(l,t,r,b,l
end;
// __________________________
procedure TForm1.eggBottom(l,t,r,b: integer);
var
half: integer;
begin
half := t+(b-t) div 2;
form1.Canvas.Arc(l,t,r,b,r
end;
// __________________________
procedure TForm1.egg(l,t,r,b: integer; egginess: integer);
var
stretch: integer;
begin
stretch := (egginess*(b-t)) div 100;
EggTop(l,t+stretch,r,b);
EggBottom(l,t,r,b+stretch)
form1.Canvas.Brush.Color := clBlue;
form1.Canvas.FloodFill((r-
end;
// __________________________
procedure TForm1.Button1Click(Sender
begin
// Left, top, width, height, egginess
egg(50,50,300,400,20);
end;
//hehe very seasonal meikl :)
inthe, how I know the traditional Eastern Egg is red :P
inthe, how I know the traditional Eastern Egg is red :P
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
perfect :-))
as all know an egg isn't a ellipse or an egg on toast,
even there are some happy pictures, spcially from drdelphi :-))
well next week a new ?simple q?
thanks to all for participating on this quest
meikl ;-)
as all know an egg isn't a ellipse or an egg on toast,
even there are some happy pictures, spcially from drdelphi :-))
well next week a new ?simple q?
thanks to all for participating on this quest
meikl ;-)
ASKER
for zabada,
i post an additional q for you,
for your also correct egg
meikl ;-)
i post an additional q for you,
for your also correct egg
meikl ;-)
ASKER
zebada,
get your points at
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20283949
get your points at
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20283949
er poached egg on toast :
var
r : trect;
begin
r.Left := 5;
r.top := 5;
r.Right := 110;
r.Bottom := 105;
form1.canvas.FrameRect(r);
form1.canvas.Ellipse(10,10
form1.Canvas.Brush.Color := clYellow;
form1.canvas.Ellipse(30,30
end;