I'm attempting to insert a file-based JPG picture into a GrapeCity (was Farpoint) Spread control, using code of this form:
var
aLoadedPic: TPicture ;
begin
fpSpread.AddCellSpan(1, 1, 5, 5) ;
fpSpread.BlockMode := True ;
fpSpread.Col := 1 ;
fpSpread.Row := 1 ;
fpSpread.Col2 := 5 ;
fpSpread.Row2 := 5 ;
fpSpread.CellType := CellTypePicture ;
fpSpread.TypePictMaintainScale := True ;
fpSpread.TypePictCenter := True ;
aLoadedPic := TPicture.Create ;
aLoadedPic.LoadFromFile('D:\Test.jpg') ;
fpSpread.TypePictPicture := aLoadedPic ;
aLoadedPic.Free ;
It's a rather old (v8) ActiveX version of the control, accessed via a TOleControl-based wrapper generated via the Delphi IDE.
All other aspects of driving the Spread control work, aside from this attempt to insert the picture (which doesn't generate any errors - it just fails silently). Removing the block mode-related lines makes no difference.
FWIW inserting a picture via the spread designer
does work, so it seems there's some route to getting one in there (unfortunately there's no route I can see for obtaining script-type lines corresponding to the designer operations).
If anyone has any suggestions for how this can be done - or, ideally, fragments of working code they can share - that would be greatly appreciated!
TIA for all responses,
Ian
Connect with Us