Форум: "Основная";
Текущий архив: 2003.08.11;
Скачать: [xml.tar.bz2];
ВнизЕсть ли способ выводить на канвас Найти похожие ветки
← →
voprosik (2003-07-29 11:11) [0]сглаженный текст и линии (геом.фигуры) ?
← →
HolACost (2003-07-29 11:12) [1]Юзай OpenGL - будет тебе сглаженный!
← →
Zergling (2003-07-29 11:21) [2]Не хош OpenGL поиши алгоритмы сглаживания в инете. Должно быть.
← →
Caligula (2003-07-29 12:00) [3]Да и вообще Canvas ещё и стирается при перетаскивании формы за пределы экрана. Ещё обработочка нужна.
← →
GROL (2003-07-30 00:45) [4]
> Да и вообще Canvas ещё и стирается при перетаскивании формы
> за пределы экрана
Рисуй в bitmap , а в onPaint-е выводи это bitmap
← →
voprosik (2003-07-30 05:27) [5]C чего вы взяли, что канва стирается???
К меня сделана масшабируемая карта города: TImage на TForm.
Рисую на канве TImage полигоны, таскаю их мышкой, увеличиваю, редактирую и т.д.
Ничего не стирается НИ при свертывании, НИ при загрытии другими окнами, НИ при перетаскивании за пределы экрана.
А вопрос про сглаживание задал потому, что в виндах есть настройка "Сглаживать экранные шрифты" и я подумал, что есть такая API функция...
← →
___Nikolay (2003-07-30 05:57) [6]Убрать зазубринки при рисовании линий можно так:
procedure TForm1.Button1Click(Sender: TObject);
var
x, y: integer;
i, j: integer;
r, g, b: integer;
begin
Form1.Canvas.Pen.Width := 10;
Form1.Canvas.MoveTo(10, 10);
Form1.Canvas.LineTo(90, 20);
for y := 0 to 10 do
begin
for x := 0 to 25 do
begin
r := 0;
for i := 0 to 3 do
for j := 0 to 3 do
r := r + GetRValue(Form1.Canvas.Pixels[4*x+i, 4*y+j]);
r := round(r / 16);
g := 0;
for i := 0 to 3 do
for j := 0 to 3 do
g := g + GetGValue(Form1.Canvas.Pixels[4*x+i, 4*y+j]);
g := round(g / 16);
b := 0;
for i := 0 to 3 do
for j := 0 to 3 do
b := b + GetBValue(Form1.Canvas.Pixels[4*x+i, 4*y+j]);
b := round(b / 16);
Form1.Canvas.Pixels[x,y+50] := RGB(r, g, b)
end;
Application.ProcessMessages;
end;
end;
← →
Думкин (2003-07-30 06:13) [7]Может есть и еще что-то, но глянь:
The CreateFont function creates a logical font with the specified characteristics. The logical font can subsequently be selected as the font for any device.
HFONT CreateFont(
int nHeight, // height of font
int nWidth, // average character width
int nEscapement, // angle of escapement
int nOrientation, // base-line orientation angle
int fnWeight, // font weight
DWORD fdwItalic, // italic attribute option
DWORD fdwUnderline, // underline attribute option
DWORD fdwStrikeOut, // strikeout attribute option
DWORD fdwCharSet, // character set identifier
DWORD fdwOutputPrecision, // output precision
DWORD fdwClipPrecision, // clipping precision
DWORD fdwQuality, // output quality
DWORD fdwPitchAndFamily, // pitch and family
LPCTSTR lpszFace // typeface name
);
fdwQuality
Specifies the output quality. The output quality defines how carefully GDI must attempt to match the logical-font attributes to those of an actual physical font. It can be one of the following values.
ANTIALIASED_QUALITY Windows NT 4.0 and later: Font is antialiased, or smoothed, if the font supports it and the size of the font is not too small or too large.
Windows 95 with Plus!, Windows 98/Me: The display must greater than 8-bit color, it must be a single plane device, it cannot be a palette display, and it cannot be in a multiple display monitor setup. In addition, you must select a TrueType font into a screen DC prior to using it in a DIBSection, otherwise antialiasing does not happen.
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2003.08.11;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.008 c