Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Image Scaling

All examples are included with download of MBS FileMaker Plugin.

Image Scaling.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts2
Value Lists0
Custom Functions0
Custom Menus0
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Image Scaling
5 fields defined, 7 records
Image Scaling

Fields

Table Name: Image Scaling - 5 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputImageNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
      SizeNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          ResultNormal, BinaryAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
              CommentNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                    InfoNormal, TextAuto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Repetitions: 1
                    • Indexing: None
                    • Automatically create indexes as needed
                    • Index Language: German

                        Layout Objects: Image Scaling

                        Regular Fields

                        Field Name: Image Scaling::InputImage
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 125 pt
                        • Left: 139 pt
                        • Bottom: 418 pt
                        • Right: 554 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        No

                        Field Name: Image Scaling::Size
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 455 pt
                        • Left: 139 pt
                        • Bottom: 476 pt
                        • Right: 392 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        Yes

                        Field Name: Image Scaling::Result
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 483 pt
                        • Left: 139 pt
                        • Bottom: 788 pt
                        • Right: 554 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        No

                        Field Name: Image Scaling::Comment
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 455 pt
                        • Left: 505 pt
                        • Bottom: 476 pt
                        • Right: 758 pt
                        • Anchoring: Left and Right, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        Yes

                        Field Name: Image Scaling::Info
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 794 pt
                        • Left: 139 pt
                        • Bottom: 815 pt
                        • Right: 392 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        Yes

                        Buttons

                        Button PropertiesCoordinatesScript/Script Step
                          Type:
                        • Text: Clear Images
                        • Top: 263 pt
                        • Left: 571 pt
                        • Bottom: 293 pt
                        • Right: 692 pt
                        • Anchoring: Left, Top
                        Perform Script [ “ClearImages” ]

                        Scripts:


                        Button PropertiesCoordinatesScript/Script Step
                          Type:
                        • Text: Scale Image
                        • Top: 483 pt
                        • Left: 571 pt
                        • Bottom: 513 pt
                        • Right: 692 pt
                        • Anchoring: Left, Top
                        Perform Script [ “Scale” ]

                        Scripts:


                        Button PropertiesCoordinatesScript/Script Step
                          Type:
                        • Text: Export Image
                        • Top: 524 pt
                        • Left: 571 pt
                        • Bottom: 554 pt
                        • Right: 692 pt
                        • Anchoring: Left, Top
                        Export Field Contents [ Image Scaling::Result; Create directories:No ]

                        Fields:


                        Script Hierarchy

                        Scale
                        ClearImages

                        Next Script: [ClearImages]
                        Script NameScale
                        Run script with full access privilegesOff
                        Include In MenuYes
                        Layouts that use this script
                        Scripts that use this script
                          Script Definition
                          Script Steps
                          • #Scale the pictur by given size
                          • #Load from container
                          • Set Variable [ $Image; Value:MBS("GMImage.NewFromContainer"; Image Scaling::InputImage) ]
                          • #Scale the image by the size that we enter in the size field
                          • Set Variable [ $r; Value:MBS("GMImage.Scale";$Image; Image Scaling::Size) ]
                          • #In case of error
                          • If [ $r ≠ "OK" ]
                          • Show Custom Dialog [ Title: "Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                          • Set Field [ Image Scaling::Info; $r ]
                          • Exit Script [ ]
                          • Else
                          • #Write image to container and set the Information text
                          • Set Field [ Image Scaling::Result; MBS("GMImage.WriteToPNGContainer"; $Image) ]
                          • Set Field [ Image Scaling::Info; MBS("GMImage.GetWidth";$Image) & " x " & MBS("GMImage.GetHeight";$Image) ]
                          • End If
                          • #Release image
                          • Set Variable [ $r; Value: MBS("GMImage.Free";$Image) ]
                          Fields used in this script
                          Scripts used in this script
                            Layouts used in this script
                              Tables used in this script
                              Table occurrences used by this script
                              Custom Functions used by this script
                                Custom menu set used by this script

                                  Previous Script: [Scale]
                                  Script NameClearImages
                                  Run script with full access privilegesOff
                                  Include In MenuYes
                                  Layouts that use this script
                                  Scripts that use this script
                                    Script Definition
                                    Script Steps
                                    • #Clear the image fields
                                    • Go to Record/Request/Page [ First ]
                                    • Loop
                                    • Set Field [ Image Scaling::Result; "" ]
                                    • Commit Records/Requests
                                    • Go to Record/Request/Page [ Next; Exit after last ]
                                    • End Loop
                                    Fields used in this script
                                    Scripts used in this script
                                      Layouts used in this script
                                        Tables used in this script
                                        Table occurrences used by this script
                                        Custom Functions used by this script
                                          Custom menu set used by this script

                                            Download example: Image Scaling

                                            Used functions: