From a83a09e9c3e0e745b9cf71dd9131b1009390bcc1 Mon Sep 17 00:00:00 2001 From: tomb0 Date: Sat, 23 Jun 2007 14:08:08 +0000 Subject: [PATCH] Fixed loading icons from Laurent Jacques git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@187 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/iconeditor/picturemanager.pas | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/applications/iconeditor/picturemanager.pas b/applications/iconeditor/picturemanager.pas index e2ad1a4a1..afc04a223 100644 --- a/applications/iconeditor/picturemanager.pas +++ b/applications/iconeditor/picturemanager.pas @@ -242,15 +242,24 @@ begin begin Icon := TIcon.Create; try + // First image in std bitmap Icon.LoadFromFile(FileName); - for I := 0 to Pred(Icon.Bitmaps.Count) do - begin - NewPage := CreatePage(Icon.Bitmaps[I] as TBitmap); - NewPage.Parent := Self; - ActivePage := NewPage; - NewPage.Caption := FindNewUniqueName; - Change; - end; + NewPage := CreatePage(Icon as TBitmap); + NewPage.Parent := Self; + ActivePage := NewPage; + NewPage.Caption := FindNewUniqueName; + Change; + + // other image in Bimaps if assigned + if Icon.Bitmaps <> nil then + for I := 0 to Pred(Icon.Bitmaps.Count) do + begin + NewPage := CreatePage(Icon.Bitmaps[I] as TBitmap); + NewPage.Parent := Self; + ActivePage := NewPage; + NewPage.Caption := FindNewUniqueName; + Change; + end; finally Icon.Free; end; @@ -387,3 +396,4 @@ end; end. +