Jump to content

Using FieldImageURL from TUniDBGrid with physical path


Mohammed Nasman

Recommended Posts

Hi All,

 

 I have multiple projects that share same images, I can view images without problem giving the physical path to the UniImage.

 

The only problem I have with event OnFieldImageURL isn't accepting the physical path, it's convert any path to full URL with the path giving, which lead to not viewing the image.

 

for example using GridImage Demo:

  if (Column.Tag = 255) and SameText(AField.FieldName, 'shift') then
  begin
    if AField.AsBoolean then
      OutImageURL := 'files/sun.jpeg'
    else
      OutImageURL := 'files/moon.jpeg';
  end;

Changing any OutImageURL to looks like this:

      OutImageURL :=  UniServerModule.StartPath + 'files/moon.jpeg';

it will be converted on runtime to the following

 

post-1329-0-46602600-1513694290_thumb.png

 

This can works fine with

TuniImage.picture.Loadfromfile(UniServerModule.StartPath + 'files/moon.jpeg');

Is there any way to override this behavior of OnFieldImageURL?

 

Regards,

Mohammed

post-1329-0-46602600-1513694290_thumb.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...