// Das Handle wird nicht benötigt.
// Durch diese Methode verlangt man vom Objekt mal in den Icon-Header zu
// schauen ansonsten könnte man die reale Icongrösse nicht erruieren bevor
// es das erste mal gezeichnet wird.
procedure TEButton.DrawPicture;
begin
if (FPicture <>
nil)
then
begin
if (FPicture.Graphic
is TIcon)
then FPicture.Icon.handle;
Canvas.Draw((Width - FPicture.Width)
div 2,(Height - FPicture.Height)
div 2 ,FPicture.Graphic);
end;
end;
procedure TEButton.DrawPictureOver;
begin
if (FPictureUseOnlyOne)
then
begin
if (FPicture <>
nil)
then
begin
if (FPicture.Graphic
is TIcon)
then FPicture.Icon.handle;
Canvas.Draw((Width - FPicture.Width)
div 2,(Height - FPicture.Height)
div 2 ,FPicture.Graphic);
end;
end
else
begin
if (FPictureOver <>
nil)
then
begin
if (FPictureOver.Graphic
is TIcon)
then FPictureOver.Icon.handle;
Canvas.Draw((Width - FPictureOver.Width)
div 2,(Height - FPictureOver.Height)
div 2 ,FPictureOver.Graphic);
end;
end;
end;
procedure TEButton.DrawPictureDown;
begin
if (FPictureUseOnlyOne)
then
begin
if (FPicture <>
nil)
then
begin
if (FPicture.Graphic
is TIcon)
then FPicture.Icon.handle;
Canvas.Draw((Width - FPicture.Width)
div 2,(Height - FPicture.Height)
div 2 ,FPicture.Graphic);
end;
end
else
begin
if (FPictureDown <>
nil)
then
begin
if (FPictureDown.Graphic
is TIcon)
then FPicture.Icon.handle;
Canvas.Draw((Width - FPictureDown.Width)
div 2,(Height - FPictureDown.Height)
div 2 ,FPictureDown.Graphic);
end;
end;
end;
end.