Subject | Problem With IB_CtrlGrid and IB_JPEGImage1 |
---|---|
Author | ajwreyford |
Post date | 2006-12-09T20:45:17Z |
I have a form that I want to organise photos, with their comments,
display order etc.
The photos are stored in a Photo table.
I have a Blob field in the table, that holds the JPeg photos.
Elsewhere in my program, I can add, scroll through records, and
delete records with photos in them. These are displayed from this
table, linked to a master table, and I have no problems.
Now I drop a IB_CtrlGrid on a form, a IB_Query and a IB_Dataset.
The IB_Query selects all records in the Photo table.
I set up the CtrlGrid so that it displays 3 rows, and 3 columns.
Orientation vertical.
I now drop a panel on the CtrlGrid, and set align to alClient.
I then drop an IB_JpegImage1 on the panel. I set the datasource and
datafield properties. If the dataset is live, the first image in the
recordset, displays in the IB_JPEGImage1 at design time.
I now compile and run the program.
When I open the form the on create event sets the dataset to live,
and then I get the following error, with the cursor at the row
indicated in the routine pasted below in module IB_Components.
Exception class EInvalidGraphic with message 'Bitmap image not
valid'. Process stopped ...
The error occurs in IB_Components:
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)
else
SaveToGraphic(TPicture(Dest).Bitmap); <******This line!
end
else
inherited AssignTo( Dest );
end;
BUT .. I'm not holding Bitmaps in the blobs, but JPEGS.
So how does it get to this?
The help file for IB_CTRLGrid just lists the properties, with nothing
else.
Hope you can help please.
I'm using 4.7 Beta 11.
Regards
Adrian
display order etc.
The photos are stored in a Photo table.
I have a Blob field in the table, that holds the JPeg photos.
Elsewhere in my program, I can add, scroll through records, and
delete records with photos in them. These are displayed from this
table, linked to a master table, and I have no problems.
Now I drop a IB_CtrlGrid on a form, a IB_Query and a IB_Dataset.
The IB_Query selects all records in the Photo table.
I set up the CtrlGrid so that it displays 3 rows, and 3 columns.
Orientation vertical.
I now drop a panel on the CtrlGrid, and set align to alClient.
I then drop an IB_JpegImage1 on the panel. I set the datasource and
datafield properties. If the dataset is live, the first image in the
recordset, displays in the IB_JPEGImage1 at design time.
I now compile and run the program.
When I open the form the on create event sets the dataset to live,
and then I get the following error, with the cursor at the row
indicated in the routine pasted below in module IB_Components.
Exception class EInvalidGraphic with message 'Bitmap image not
valid'. Process stopped ...
The error occurs in IB_Components:
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)
else
SaveToGraphic(TPicture(Dest).Bitmap); <******This line!
end
else
inherited AssignTo( Dest );
end;
BUT .. I'm not holding Bitmaps in the blobs, but JPEGS.
So how does it get to this?
The help file for IB_CTRLGrid just lists the properties, with nothing
else.
Hope you can help please.
I'm using 4.7 Beta 11.
Regards
Adrian