![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 10 total |
![]() |
Wed, May 31 2017 4:28 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. ![]() | HI,
I am having trouble getting an image in a grid to scale to show the whole image. I have an image as a Base64 encoded string (downloaded from the server) and I can display it on the screen using TImage background and stContain and it displays the whole image. But if I create a column in a Grid and set the column control type to be ctImage and the ImageLayout siz eto be csContain it only shows a portion of the image. (See attached screenshot) Any ideas? -- Chris Holland [Team Elevate] Attachments: Scale Image.jpg |
Wed, May 31 2017 5:02 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. ![]() | I forgot to mention I have this code on the Cell update as well to get
the image to appear: procedure TSelectAreaForm.AuditGridImageColCellUpdate(Sender: TObject; ACell: TGridCell); begin ACell.Background.Image.Name := 'data:image/jpeg;base64,' + ACell.Data; end; Chris Holland [Team Elevate] On 31/05/2017 09:28, Chris Holland wrote: > HI, > > I am having trouble getting an image in a grid to scale to show the > whole image. > > I have an image as a Base64 encoded string (downloaded from the server) > and I can display it on the screen using TImage background and stContain > and it displays the whole image. > > But if I create a column in a Grid and set the column control type to > be ctImage and the ImageLayout siz eto be csContain it only shows a > portion of the image. > > (See attached screenshot) > > Any ideas? > -- Chris Holland [Team Elevate] |
Wed, May 31 2017 12:58 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Chris,
<< But if I create a column in a Grid and set the column control type to be ctImage and the ImageLayout siz eto be csContain it only shows a portion of the image. >> I'm looking into this.... Tim Young Elevate Software www.elevatesoft.com |
Mon, Jul 3 2017 2:09 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Chris,
Okay, sorry for the long delay on getting back to you on this. The issue is that you're setting the background image, but using the layout options for non-background images. For non-background images (ControlType=ctImage), the URL for the image is supplied in the data for the actual cell, not via the background image name. You can do this with a calculated dataset column, if you need to prefix the incoming data so that it is recognized as a data url image. Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 5 2017 8:03 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. ![]() | Hi Tim,
My problem seems to be that I cannot set the data for an image col from a data table string. For my normal images I just set the background image with something like this: AreaImage.URL := 'data:image/jpeg;base64,' + Area.ImageData; Where the 'Area.ImageData' is a Base64 encoded string created from an image. ===================== If I setup a grid column with ControlType := ctImage and the DataColumn pointing to a string field in a table containing the same data, no image appears. Chris Holland [Team Elevate] On 03/07/2017 19:09, Tim Young [Elevate Software] wrote: > Chris, > > Okay, sorry for the long delay on getting back to you on this. > > The issue is that you're setting the background image, but using the layout options for non-background images. For non-background images (ControlType=ctImage), the URL for the image is supplied in the data for the actual cell, not via the background image name. You can do this with a calculated dataset column, if you need to prefix the incoming data so that it is recognized as a data url image. > > Tim Young > Elevate Software > www.elevatesoft.com > |
Wed, Jul 5 2017 11:54 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Chris,
<< If I setup a grid column with ControlType := ctImage and the DataColumn pointing to a string field in a table containing the same data, no image appears. >> Does the data contain the proper data-url prefix ? If not, then that is why I recommended a calculated column that adds it to the data. You could also use an OnGetText event handler for the data column in order to add the proper prefix. Tim Young Elevate Software www.elevatesoft.com |
Thu, Jul 6 2017 7:49 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. ![]() | Hi Tim,
Yes the data starts with this: data:image/jpeg;base64, ......etc Chris Holland [Team Elevate] On 05/07/2017 16:54, Tim Young [Elevate Software] wrote: > Chris, > > << If I setup a grid column with ControlType := ctImage and the DataColumn pointing to a string field in a table containing the same data, no image appears. >> > > Does the data contain the proper data-url prefix ? If not, then that is why I recommended a calculated column that adds it to the data. You could also use an OnGetText event handler for the data column in order to add the proper prefix. > > Tim Young > Elevate Software > www.elevatesoft.com > |
Thu, Jul 6 2017 10:58 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Chris,
<< Yes the data starts with this: data:image/jpeg;base64, ......etc >> Okay, it's an issue with the semicolon in the data-URL. I'm going to have to put in a check for this. I've got to do a new build 4, anyway, though, due to a bug in the local web server debug logging, so that will be out today and it will include this fix. Tim Young Elevate Software www.elevatesoft.com |
Thu, Jul 6 2017 2:55 PM | Permanent Link |
Chris Holland SEC Solutions Ltd. ![]() | That has fixed it thanks Tim.
Chris Holland [Team Elevate] On 06/07/2017 15:58, Tim Young [Elevate Software] wrote: > Chris, > > << Yes the data starts with this: > > data:image/jpeg;base64, ......etc >> > > Okay, it's an issue with the semicolon in the data-URL. I'm going to have to put in a check for this. > > I've got to do a new build 4, anyway, though, due to a bug in the local web server debug logging, so that will be out today and it will include this fix. > > Tim Young > Elevate Software > www.elevatesoft.com > |
Thu, Jul 6 2017 4:30 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Chris,
<< That has fixed it thanks Tim. >> Cool, thanks for the update. ![]() Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, December 1, 2023 at 06:01 PM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |