graphic property editor: use TBitmap.Assign instead of setting width, height and drawing on white box

git-svn-id: trunk@13428 -
This commit is contained in:
paul 2007-12-23 09:10:34 +00:00
parent 5cfbb26ced
commit 9825141ffc

View File

@ -202,11 +202,14 @@ begin
Ext := ExtractFileExt(TheDialog.FileName);
if ABitmap = nil then
ABitmap := TBitmap.Create;
if (ABitmap is TBitmap) and
((CompareText(Ext, '.xpm') = 0) or
(CompareText(Ext, '.bmp') = 0)) then
// Paul: can it be not TBitmap at all?
if (ABitmap is TBitmap) then
begin
ABitmap.LoadFromFile(TheDialog.FileName);
if ((CompareText(Ext, '.xpm') = 0) or (CompareText(Ext, '.bmp') = 0)) then
ABitmap.LoadFromFile(TheDialog.FileName)
else
ABitmap.Assign(TheDialog.Preview.Picture.Graphic);
end
else
begin