Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.06.20;
Скачать: CL | DM;

Вниз

Как поменять стиль шрифта?   Найти похожие ветки 

 
red chief ©   (2004-06-08 18:53) [0]

Почему у меня не меняет стиль шрифта?:
procedure TForm1.Button1Click(Sender: TObject);
var pic:TBitmap;
i,w:integer;
begin
pic:=TBitmap.Create;
pic.Width:=0;
pic.Height:=0;
for i:=0 To Memo1.Lines.Capacity-1 do begin
if Canvas.TextWidth(Memo1.Lines[i])>pic.Width then
pic.Width:=Canvas.TextWidth(Memo1.Lines[i]);
pic.Height:=pic.Height+Canvas.TextHeight("Red");
PaintBox1.Canvas.TextOut(0,Canvas.TextHeight("Red")*i,Memo1.Lines[i]);
end;

 if checkBox1.checked=true then pic.canvas.Font.Style:=[fsbold];
 if checkBox2.checked=true then pic.canvas.Font.Style:=[fsitalic];
 if checkBox3.checked=true then pic.canvas.Font.Style:=[fsunderline];

 if (checkbox1.checked=true) and (checkbox2.checked=true) then
 pic.canvas.Font.Style:=[fsbold,fsitalic];

 if (checkbox1.checked=true) and (checkbox3.checked=true) then
 pic.canvas.Font.Style:=[fsbold,fsunderline];

 if (checkbox2.checked=true) and (checkbox3.checked=true) then
 pic.canvas.Font.Style:=[fsitalic,fsunderline];

 if (checkbox1.checked=true) and (checkbox2.checked=true) and
 (checkbox3.checked=true) then
 pic.canvas.Font.Style:=[fsbold,fsitalic,fsunderline];
end;


 
TUser ©   (2004-06-08 18:59) [1]

with pic.canvas.Font do begin
Style:=[];
if checkBox1.checked then Style:=Style+[fsbold];
if checkBox2.checked then Style:=Style+[fsitalic];
if checkBox3.checked then Style:=Style+[fsunderline];
end;

Это во-первых. А еще, ты ведь сначала текст печатаешь, а потом слить шрифта устанавливаешь. А надо наоборот.


 
Zeqfreed ©   (2004-06-08 19:53) [2]


procedure TForm1.Button1Click(Sender: TObject);
var pic:TBitmap;
i,w:integer;
begin
pic:=TBitmap.Create;
with PaintBox1.canvas.Font do begin
Style:=[];
if checkBox1.checked then Style:=Style+[fsbold];
if checkBox2.checked then Style:=Style+[fsitalic];
if checkBox3.checked then Style:=Style+[fsunderline];
end;
for i:=0 To Memo1.Lines.Capacity-1 do begin
if Canvas.TextWidth(Memo1.Lines[i])>pic.Width then
pic.Width:=Canvas.TextWidth(Memo1.Lines[i]);
pic.Height:=pic.Height+Canvas.TextHeight("Chief");
PaintBox1.Canvas.TextOut(0,Canvas.TextHeight("Chief")*i,Memo1.Lines[i]);

end;
end;



Страницы: 1 вся ветка

Текущий архив: 2004.06.20;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.048 c
14-1086329974
Мазут Береговой
2004-06-04 10:19
2004.06.20
Россия - один из штатов Америки?


3-1085497896
Elast
2004-05-25 19:11
2004.06.20
Установка FB 1.5


1-1086075417
V-Isa
2004-06-01 11:36
2004.06.20
Ребята, подскажите с чего начать.


3-1085616370
Almaz
2004-05-27 04:06
2004.06.20
Конструктор connection string


11-1074520305
avakss
2004-01-19 16:51
2004.06.20
statusctl