Subject | Ib_JpegImage, and Ctrl Grid .. asign appears to be the problem |
---|---|
Author | Adrian Wreyford |
Post date | 2006-12-21T09:30:13Z |
Dear Jason, anybody with free time!
OK So I'm desperate.. I've been at it for 4.5 hours now solid, just
debugging the test I sent you.
I removed the datasource for all the other JpegImages in the test
example to make the debugging easier, else have to follow all their
drawing aswell.
When your scroll the dataset, so that the second column of the ctrl grid
also has data assigned to it, the Ctrlpanel creates the new tWincontrol,
then from the buffer, it assigns the new buffer links:
RefreshDataLinks( FPanel ); (IB_CGrid:1154)
The first one is loaded, and assigned properly, but the second image, is
not .. it sees it as a bitmap, for some or other unknown reason, so
branches incorrectly.
In IB_Components (45042):
procedure TIB_ColumnBlob.AssignTo( Dest: TObject );
begin
if Dest is TIB_ColumnBlob then
SaveToBlob(TIB_ColumnBlob( Dest ))
else
if Dest is TStrings then
SaveToStrings(TStrings(Dest))
else
if Dest is TStream then
SaveToStream(TStream(Dest))
else
if Dest is TGraphic then
SaveToGraphic(TGraphic(Dest))
else
if Dest is TPicture then
begin
if Assigned( TPicture(Dest).Graphic ) then
SaveToGraphic(TPicture(Dest).Graphic) <--first time goes through
here! (for first image.)
else
SaveToGraphic(TPicture(Dest).Bitmap); <--for second image
through here! (why I don't know!!)
end
else
inherited AssignTo( Dest );
The very first time you run the program, and only one record, then no
assining happens, thus TIB_ColumnBlob.AsignTo only called when recordset
scrolled, and more than one record now! Perhaps this is as the new
IB_JpegImage is created dynamically as with all the controls dropped on
the IB_Grid for the 2nd on rows!. Now the problem arrises when assigning
to dynamically created controls at runtime.
So first time the CtrlGrid WMPaint creates the "bitmap", then it is
drawn in TIB_CustomJPEGImage.Paint;
Then when one scrolls, (now two records, thus two columns need to be
drawn with jpeg images in), the buffer pointers are advanced, and then
we get the AsignTo call, that incorrectly branches to
SaveToGraphic(TPicture(Dest).Bitmap); resulting in the error.
Perhaps this has something to do with the way blob columns are handled
in the buffer?? ? cached updates IB_Components line 24578?
I'll keep on trying, but my free time is running out, and I'm not so
sure the problem lies with the freeware IB_JPEGImage of Tomas, but
rather with the way the ctrlgrid handles blob columns.
PLEASE give it a morsel of attention.!
Adrian
end;
[Non-text portions of this message have been removed]
OK So I'm desperate.. I've been at it for 4.5 hours now solid, just
debugging the test I sent you.
I removed the datasource for all the other JpegImages in the test
example to make the debugging easier, else have to follow all their
drawing aswell.
When your scroll the dataset, so that the second column of the ctrl grid
also has data assigned to it, the Ctrlpanel creates the new tWincontrol,
then from the buffer, it assigns the new buffer links:
RefreshDataLinks( FPanel ); (IB_CGrid:1154)
The first one is loaded, and assigned properly, but the second image, is
not .. it sees it as a bitmap, for some or other unknown reason, so
branches incorrectly.
In IB_Components (45042):
procedure TIB_ColumnBlob.AssignTo( Dest: TObject );
begin
if Dest is TIB_ColumnBlob then
SaveToBlob(TIB_ColumnBlob( Dest ))
else
if Dest is TStrings then
SaveToStrings(TStrings(Dest))
else
if Dest is TStream then
SaveToStream(TStream(Dest))
else
if Dest is TGraphic then
SaveToGraphic(TGraphic(Dest))
else
if Dest is TPicture then
begin
if Assigned( TPicture(Dest).Graphic ) then
SaveToGraphic(TPicture(Dest).Graphic) <--first time goes through
here! (for first image.)
else
SaveToGraphic(TPicture(Dest).Bitmap); <--for second image
through here! (why I don't know!!)
end
else
inherited AssignTo( Dest );
The very first time you run the program, and only one record, then no
assining happens, thus TIB_ColumnBlob.AsignTo only called when recordset
scrolled, and more than one record now! Perhaps this is as the new
IB_JpegImage is created dynamically as with all the controls dropped on
the IB_Grid for the 2nd on rows!. Now the problem arrises when assigning
to dynamically created controls at runtime.
So first time the CtrlGrid WMPaint creates the "bitmap", then it is
drawn in TIB_CustomJPEGImage.Paint;
Then when one scrolls, (now two records, thus two columns need to be
drawn with jpeg images in), the buffer pointers are advanced, and then
we get the AsignTo call, that incorrectly branches to
SaveToGraphic(TPicture(Dest).Bitmap); resulting in the error.
Perhaps this has something to do with the way blob columns are handled
in the buffer?? ? cached updates IB_Components line 24578?
I'll keep on trying, but my free time is running out, and I'm not so
sure the problem lies with the freeware IB_JPEGImage of Tomas, but
rather with the way the ctrlgrid handles blob columns.
PLEASE give it a morsel of attention.!
Adrian
end;
[Non-text portions of this message have been removed]