Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

Заливка многогранника [D7, WinXP]


Larry ©   (2004-02-11 20:01:00) 

Как с помощью Brush залить многогранник, т.е. область определения фигуры задать с помощью пяти или шести точек???


Larry   (2004-02-13 06:42:00) [1]

Спасибо, Dmyk! Bv[j? енто мне и нужно было!!!


Mihey   (2004-02-12 20:22:00) [2]

Dmyk верно говорит - порой может оказаться сложно определить такую точку для FloodFill, чтобы она была внутри многоугольника.


Dmyk   (2004-02-12 19:52:00) [3]

FllodFill - заливка уже нарисованного прямоугольника.

ИМХО, если мы знаем точки и их кол-во фиксировано, то лучше использовать Polygon.

var
 MyPoints: array [0..5] of TPoint;
 I: Integer;
begin
  forI := 0 to5 do begin
   MyPoints[I} := Point(Random(Width), Random(Height)
  end; {вообще-то лучше это в другом месте формировать}
  withCanvas do begin
   Brush.Color := $00FFFFC0; //типа clSkyBlue
   Pen.Width := 0;
   Polygon(MyPoints);
  end;
end;


able   (2004-02-12 15:33:00) [4]

Нет нельзя! Тут подробный ответ!!


KilkennyCat   (2004-02-11 22:39:00) [5]

procedure FloodFill(X, Y: Integer; Color: TColor; FillStyle: TFillStyle);

Description

Use FloodFillto fill a possibly non-rectangular region of the image with the value of Brush. The boundaries of the region to be filled are determined by moving outward from the point (X,Y) until a color boundary involving the Color parameter is encountered.

FillStyle determines what type of color changes define the boundaries, as indicated in the following table.

fsSurfaceFill all area that has the color indicated by the Color parameter. Stop when another color is encountered.
fsBorderFill all area that does not have the color indicated by the Color parameter. Stop when Color is encountered.

Use the Pixels property to get the exact value of the color at the point (X,Y) when using a FillStyle of fsSurface. Similarly, when FillStyle is fsBorder, use Pixels to get the exact value of the boundary color if a point on the boundary is known.


Larry   (2004-01-23 13:18:00) [6]

А если подробнее и на русском. Блин, ну это же форум. Неужели нельзя своими словами?!


Наверх

Титульная страница Поиск, карта сайта Написать письмо