Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
VCL
8-Byte Alignment
Action Classes
Additional Controls
Core VCL Classes
DFM to TEXT
Dialog Controls
Docking
Drag/Drop
Emulation Classes
Exceptions
Gestures
Graphics
MAPI Support
MDI Support
Multi-Monitor Support
OnGesture event
Printing
Property/Type Editors
Registry / INI Objects
Ribbon Controls
Sample Controls
Services
Standard Controls
Styles
System Controls
Thread support
Touch Controls
Type Info
Win 3.1 Controls
Win 32 Controls
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/VCL/Graphics
[ Add a report in this area ]
Report #:
83992
Status:
Open
TImageList is always copied on form/frame inheritance even when no changes are made.
Project:
Delphi
Build #:
3593
Version:
16.0
Submitted By:
Mason Wheeler
Report Type:
Minor failure / Design problem
Date Reported:
4/19/2010 2:13:06 PM
Severity:
Serious / Highly visible problem
Last Updated:
4/12/2012 1:47:51 AM
Platform:
All platforms
Internal Tracking #:
276050
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
4.00 out of 5
Total Votes:
9
Description
When a TImageList is used in a form or frame, and the form or frame is later used on another form, (either through placing the frame on a form or through form inheritance,) the entire TImageList's image data gets copied to the new DFM, even if no changes have been made.
This was not the case in D2007. Haven't checked in D2009.
Steps to Reproduce:
Create a frame.
Place a TImageList on the frame.
Put an image in the TImageList.
Save the TImageList.
Create a form.
Place the frame on the form, unchanged.
Save the form.
Examine the DFM for the form, and see that the image data is there for no good reason.
Alternative steps and information by USc:
- save the attachment
- start Delphi
- open QC83992.dpr
- open QC83992ImageListFrame.pas and add it to the palette (Form Designer popup menu "Add To Palette")
- open QC83992Main.pas in the Form Designer
- add QC83992ImageListFrame.pas from the palette to QC83992Main
- ALT + F12
expected: the is no Bitmap property for ImageList1 or no ImageList1 at all
object fmQC83992: TfmQC83992
...
inline TfrmQC83992ImageList1: TfrmQC83992ImageList
...
end
end
actual: the is a ImageList1 with a Bitmap property
object fmQC83992: TfmQC83992
...
inline TfrmQC83992ImageList1: TfrmQC83992ImageList
...
inherited ImageList1: TImageList
Bitmap = {
...
}
end
end
end
Additional notes:
It seems that the reason is something in the streaming of the imagelist content, because the only difference between the bitmap in the frame and in the form is the 9th byte.
The value of 9th byte in the form is the value of the frame + 4
Form:
Bitmap = {
494C01010100080040
Frame:
Bitmap = {
494C0101010008003C
When you repeatedly switch between the Form Designer and the form text you see that the value of the 9th byte gets always higher and higher and is last value + 4.
The issue does NOT occur because of looking with ALT + F12 into the form text! (It is enough to put the frame onto the form, save the form and look on the disk and see that the file is to big...)
This issue is probably related to the ComCtrls version and the ImageList_Write/ImageList_WriteEx function, because the issue repeats also with D2007 on W2k (IE 6) and Win 7 although the reporter claims that it wouldn't occur with D2007.
Workarounds
Manually culling the DFM files will work, until the next time you edit the form at least...
Attachment
QC83992.zip
Comments
Mason Wheeler at 4/19/2010 2:15:51 PM
-
It's worth noting that if you go back later and edit the original list, the changes don't get propagated to the form that uses it because the image data that's already there will override it. This can lead to unpredictable behavior.
Steven Kamradt at 4/19/2010 2:21:23 PM
-
I also noticed that if there are no changes to an image list, just loading the form and saving it will change the order of a byte or two which will show up when a diff against a previous version is performed. I believe this may be related to why it brings in the entire imagelist.
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us