Jump to content

Will FMP18 FILL a container field with a picture, rather than FIT it


Recommended Posts

Hi All,

Apologies for perhaps being in the wrong part fo the forums for this query!

I'm on FMP16 right now, and I've a container field that I use to display square pictures of people. Due to different layouts, the container is landscape on one, and portrait on another (ie wider on one, and taller on another). Because the only option in FMP 16 is to FIT the image, when the container is wider than tall, either the image is distorted or there are gaps on the sides, depending on whether I've got the 'maintain  proportions' box checked or not. And similarly, when the container is taller, then the image is either distorted or there are gaps on the top and bottom.

What I'm after is being able to FILL the container, so that whilst I loose a bit of the image on the sides or tops, the container is filled without distortion. Is this possible with FMP 18? (If there's a work around for FMP 16 I'd love to know it, but I don't think there is!!)

Many thanks in advance :)

 

584157452_Screenshot2020-01-10at10_03_50.jpg.0395ca946833811add48131c984409d0.jpg

Link to post
Share on other sites

Thanks but sadly that doesn't work. The function just resizes the image with the same proportions, so it effectively changes the pixel count but no the aspect ratio. And so because of this, when I show that thumb in the layout, I have the same problems as before :(

Link to post
Share on other sites

Thanks Comment.

It's a portal where each person has a portal row, so I have to keep it in FM. And in some layouts the best shape for the container is tall, and in some other layouts it's wide ... and I guess I can't have Fill as things stand.

I've been researching it a bit, and here's an old post that sums it up very well. It can be done for a graphic fill, but not a container :( https://community.filemaker.com/en/s/idea/0870H000000fyddQAA It's from 3 years ago, and so whilst I think it's the most sensible thing in the world, and something that it's crazy not to have, I guess Filemaker don't think the same way!

It's one of those ones where I think everyone must have the same issue, but I guess not. I'll try to let it go 🤯

Here's another one post where someone from FM seems to be saying that it can't happen: https://community.filemaker.com/en/s/question/0D50H00006ti3ctSAA/how-do-i-change-how-an-image-displays-in-a-container-field

I wish I could think of a workaround, but because I have the need for a taller container sometimes, and a wider container other times, I guess not 😱

Link to post
Share on other sites
15 hours ago, Slater said:

Thanks but sadly that doesn't work. The function just resizes the image with the same proportions, so it effectively changes the pixel count but no the aspect ratio. And so because of this, when I show that thumb in the layout, I have the same problems as before :(

I just tested this and it seems to work. Change the display field to "crop to frame" rather than reduce/enlarge, and then use GetThumbnail to set the image size to slightly bigger than the field's dimensions. You said you didn't want to change the aspect ratio.

Link to post
Share on other sites

Thanks Comment and thanks Fitch.

Great idea to check out plug ins. I've had a quick look.

Also, really cool of you to have got back to me Fitch. I've had a play with this, and this won't work if the original picture is smaller than the container. In that case, it seems to me, GetThumbnail won't work, which is why it didn't seem to be working for me, when I checked it out. The particular layout that I was using meant that it didn't appear to be working.

But if the original is larger, then it does!!

Yay, thanks Fitch, that seems to do the job ... now to resize all the originals that are too small 😳🤓

Link to post
Share on other sites

Also, just FYI there are some problems with this if the images are different sizes. GetThumbnail only returns a consistently sized thumbnail when the originals are the same size. So if your library of images are different sizes, then you will need to plug in different values to the GetThumbnail function.

The toss up being that this will only work seamlessly if all of you images are exactly the same size. (It's better than the default situation though, so I'm not complaining!) 

Link to post
Share on other sites

Earlier I was confused by your saying:

On 1/14/2020 at 7:29 PM, Slater said:

The function just resizes the image with the same proportions, so it effectively changes the pixel count but no the aspect ratio.

But in fact you do NOT want to change the aspect ratio, so that's not a good reason why the GetThumbnail() function wouldn't work for you. I might be reluctant to use it for reasons of image quality, but if this is for on-screen display only (and there is no requirement for a hi-res on-screen display), it can work.

 

On 1/15/2020 at 1:36 PM, Slater said:

there are some problems with this if the images are different sizes.

There should be no problems with this because the target size (or rather the size limits, if you're using  the GetThumbnail() function) can be calculated using the source image dimensions as the input. These dimensions can be retrieved using the GetHeight() and GetWidth() functions as well as the GetContainerAttribute() functions.

If you like, you can make this completely dynamic by giving the target container an object name and getting its dimensions via the GetLayoutObjectAttribute() function. Then the calculation can automatically adjust the size to fit the size of the target container on the current layout (but then it must be unstored).

 

On 1/15/2020 at 11:52 AM, Slater said:

now to resize all the originals that are too small

I would be careful with that. Resizing an image results in permanent loss of quality.

 

Edited by comment
Link to post
Share on other sites
  • 2 weeks later...
On 1/17/2020 at 9:05 PM, comment said:

There should be no problems with this because the target size (or rather the size limits, if you're using  the GetThumbnail() function) can be calculated using the source image dimensions as the input. These dimensions can be retrieved using the GetHeight() and GetWidth() functions as well as the GetContainerAttribute() functions.

If you like, you can make this completely dynamic by giving the target container an object name and getting its dimensions via the GetLayoutObjectAttribute() function. Then the calculation can automatically adjust the size to fit the size of the target container on the current layout (but then it must be unstored).

 

Thanks Comment, as ever! Apologies for my late reply, I've been tied up with something.

That's such a cool way to go about it. I think I could create three outputs, 3x2, 2x3 and 1x1, and then just standardise all containers so that they're one of those three.

Thanks for helping me figure this, cheers :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Similar Content

    • By Kitesurfer
      Hi,
      I am pretty sure I have done this correctly but the result is not there.
      I have attached a few screenshots that will explain everything I believe.
      Looking forward to some help.
      PS. I have also had some issues importing excel sheets meaning the source fields (Excel did not show, therefore I could not line them up with the relevant Filemaker fields)
      Maybe my Filemaker is corrupted, although I have never encountered Filemaker be corrupted.
      Anyway hope someone can shed some light on this
      Kind regards
      Rudy



    • By DataCruncher
      This is strange. 
      Two FMS18 servers on Mac. 
       
      Both run a similar database file I had synced with mirrorsync. One of the tables is not that important but slowed mirrorsync down, so I decided to not mirror that table between server 1 and server 2, but instead make server 2 an external data source to server 1. 
       
      I add server 2 as external data source to server 1. 
       
      Then, things start to get weird. The table I wanted from eh external source I deleted from server 1. Yet, when I add server 2 as external datasource, it defaults back to the local file? 
      I can tell that's what's happening according to two observations: server 2 has the table X; server 1 does not as I deleted it. 
      Also, the external data source management windows shows file:FILE.fmp12 instead of fmnet://server2.xyz.com/FILE.fmp12
       
      How on earth can that happen? Filemaker seems to connect to server 2 but then think it's the same as the local file and decide for me to take the file on server 1 instead of the file on server 2?
       
      Very strange!
       
      Thank you!
       
       
    • By Spidey
      Hi,
      I have two table: Invoice and Customer.  I like to have the total of all the invoice for a customer between certain date in the Customer portal that show all the customers, but I got a error when I try to debug..
      ExecuteSQL("SELECT SUM(I.TotalAmount) FROM Invoice I JOIN Customer C ON I._kf_CustomerID = C.__kp_CustomerID WHERE date(I.InvoiceDate) between date(C.SearchFromDate ) and   date(C.SearchToDate )" ; "" ; "" )
      I have an error and couldn't figure it out.  Thanks...
      KC


    • By Todd Dignan
      I have a client that has been using a send email script step  that brings up the outlook email client on the desktop.  This as worked for years no problem.  It has stopped work on 3 of 35 computers within the last two weeks.  I talked with there IT personal and they have assured me that no updates have happened.  The actual error is -
      Microsoft Office Outlook
      Either there is no default mail client or the current mail client cannot
      fulfill the messaging request.  Please run Microsoft Outlook and set it as
      the default mail client.
       
      I have double checked with system default  and Outlook's settings.  Both are set to default.
      The client is using the latest version of office 360's and the latest version of FileMaker 18 advance. Both 64bit.
      Any suggestions are welcome.


    • By tbcomputerguy
      I have an excel sheet that controls bills of ladings for a forestry company.  In the example you can see that there is lots going on with this Bill.  It has a payperiod, mill, truck that delivered it, etc.
      I would like setup a database to monitor this.  The fields CT1, CT2, Skid1, Skid2. PROC1, PROC2 are all contractor numbers.  There are 6 contactors.  The percentages in each line are the amount of the volume they performed  In the third line there is a value in CT1 only...they get 100% of the volume.  I can figure out most of this, but am stumped on how I can monitor when a contractor does multiple jobs..ie in line one, contractor 5, cuts and skids.  All 6 contractors could be involved in one BOL. Each one of these jobs, cutting, skidding and processing each has their own respective rate of pay as well.   I think i need a way to break down each line so that I can produce pay summaries for each of the contractors.  I had started this years ago, and thought I asked in a forum, but can't remember where.  Nonetheless, they stopped using multiple contractors per load...Now they have returned, so I am back at it.  So if this is a repost from years ago I apologize.  
      Thanks in Advance
      tbcomputerguy
       
       

  • Who Viewed the Topic

    1 member has viewed this topic:
    Ocean West 

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.