![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Встевить рисунок в StatusBar
Fenix © (2006-03-16 12:18:00)Доброго времени суток.
Мне нужно вставить рисунок в статус бар..
StatusBar1.Canvas.Draw(Rect.Left, Rect.Top, icon);
мне нужно вставить рисунок из Imagelist, но как его перевести в формат TGraphic?
balepa (2006-03-17 06:44:00) [1]Не ставь XtatusBar1.refresh в StatusBar1.OnDrawPanel
У тебя хоть одна панель есть то?
balepa (2006-03-17 06:07:00) [2]Description
The OnDrawPanel event occurs when a status panel needs to be redisplayed—for example, when the user resizes the status bar. OnDrawPanel occurs only if the status panel’s Style property is set to psOwnerDraw.
Fenix (2006-03-16 14:06:00) [3]мне надо b освобождать в самом конце программы... Так что ошибка в чемто другом... Пытался обнавлять XtatusBar1.refresh. но тоже ничего не дает :(
balepa (2006-03-16 13:51:00) [4]Наверно еще b.Free надо делать
balepa (2006-03-16 13:34:00) [5]Occurs when a status panel needs to be redrawn.
Delphi syntax:
property OnDrawPanel: TDrawPanelEvent;
C++ syntax:
__property TDrawPanelEvent OnDrawPanel = {read=FOnDrawPanel, write
=FOnDrawPanel};
Description
The OnDrawPanel event occurs when a status panel needs to be redisplayed—for example, when the user resizes the status bar. OnDrawPanel occurs only if the status panel’s Style property is set to psOwnerDraw.
Fenix (2006-03-16 13:18:00) [6]пишу так:
в глобальных объявляю:
var
b: TBitMap;
.....
Затем при создании формы:
ImageList1.GetBitmap(3,b);
......
Потом в StatusBar1->OnDrawPanel:
StatusBar1.Canvas.Draw(Rect.Left, Rect.Top, b);
но не прорисовываеться иконка... в чем может быть ошибка?
balepa (2006-03-16 13:04:00) [7]можно и так
var
b: TBitMap;
begin
b:= TBitmap.Create;
ImageList1.GetBitmap(0,b);
Statusbar1.Canvas.Draw(1,1,b);
p.s. TBitmap = class(TGraphic)
balepa (2006-03-16 13:02:00) [8]var
g: TGraphic;
b: TBitMap;
begin
g:= TGraphic.Create;
b:= TBitmap.Create;
ImageList1.GetBitmap(0,b);
g:= b;
Statusbar1.Canvas.Draw(1,1,g);
Fenix (2006-03-16 12:53:00) [9]С Image то все ясно... мне надо из imagelist взять этот рисунок... допустим у рисунка индекс 25. Как мне его перевести в TGraphic?
balepa (2006-03-16 12:33:00) [10]var
g: TGraphic;
begin
g:= TGraphic.Create;
g:= Image1.Picture.Graphic;
Statusbar1.Canvas.Draw(1,1,g);
end;
тока рисунок поменьше
balepa (2006-03-16 12:32:00) [11]
> но как его перевести в формат TGraphic?
var
g: TGraphic;
begin
g:= TGraphic.Create;
g:= Image1.Picture.Graphic;
image2.Picture.Graphic:= g;
end;