PHP Generator Feature Demo
  • Themes
    • Default
    • Default compact
    • Cerulean
    • Cerulean compact
    • Cosmo
    • Cyborg
    • Darkly
    • Darkly compact
    • Facebook
    • Flatly
    • Journal
    • Lumen
    • Paper
    • Readable
    • Sandstone
    • Simplex
    • Slate
    • Slate compact
    • Spacelab
    • Superhero
    • Superhero compact
    • United
    • United compact
    • Yeti
    • Yeti compact
  • English
    • German
    • Brazilian
    • Czech
    • Danish
    • Spanish
    • Finnish
    • French
    • Hungarian
    • Italian
    • Dutch
    • Polish
    • Russian
    • Swedish
    • Slovak
    • Slovenian
    • Serbian
    • Turkish
    • Arabic
  • Learn more
    • PHP Generator Feature Demo
    • About this demo
    • Download project file for this demo
    • Check out other PHP Generator demos
    • NBA Database Demo
    • Security Demo
    • MySQL Schema Browser Demo
    • Learn more about our products
    • Try PHP Generator for free
    • SQL Maestro Group website
    • Follow us
    • Facebook
    • Twitter
    • YouTube
  • Recently added/updated
    • Grid Toolbar
    • Tabbed Forms
    • Stepped Area Chart
    • Candlestick Chart
    • Histogram Chart
    • Bubble Chart
    • Timeline Chart
    • Gantt Chart
    • Scatter Chart
    • Tree Map Chart
    • Export options
    • Invoice generation
    • Inline Button
    • HTML Wysiwyg
    • Watermarks
  • Data Grid
    • Table View
    • Card View
    • Autohiding Columns
    • Totals
    • Grid Header
    • Column Grouping
    • Record Comparison
    • Unicode Support
    • RSS
    • Custom Drawing
    • Custom Table Template
    • Custom Card Template
    • Custom Toolbar Template
    • Custom View Form
  • Grid Columns
    • Column Types
    • Text Truncating
    • Column Fixed Width
    • Formatting
    • Null Label
    • Hyperlinks
    • Html Display
    • Lookup Data View
    • Custom Rendering
  • Grid Options
    • Fixed Grid Width
    • Fixed Column Header
    • Bordered Table
    • Condensed Table
    • Line Numbers
    • Control Buttons Position
  • Data Sources
    • Table
    • View
    • Non-Updatable Query
    • Updatable Query
    • Updatable View
  • Master-Detail Views
    • Master/Detail Basics
    • Multiple Details
    • Nested Details
    • Card Mode Details
  • Data Input Forms
    • Separate Page
    • Modal Window
    • Inline Editing
    • Form Layouts
    • Tabbed Forms
    • Custom Separate Page
    • Custom Modal Dialog
    • Custom Inline Form
    • Wizard Form
    • Adding multiple records
    • Editors Overview
    • Validation
    • Client-side API
    • Dependent Lookups
    • On-the-Fly Adding
    • Quick Edit
    • Multi Edit
    • Custom Default Values
  • Editors
    • Text
    • Autocomplete
    • Text Area
    • HTML Wysiwyg
    • Spin & Range
    • Upload To Folder
    • Radio Group
    • Combobox
    • Dynamic Combobox
    • Cascading Combobox
    • Dynamic Cascading Combobox
    • Multiple Select
    • Checkbox Group
    • Common Properties
  • Data Filtering
    • Quick Filter
    • Filter Builder
    • Column Filter
    • Preliminary Filter
    • Selection Filters
    • Custom Filter - 1
    • Custom Filter - 2
  • Sorting
    • Sort By Click
    • Sort By Dialog
    • Default Sort Order
  • Partitioning
    • Range
    • List
    • Custom
  • Exporting & Printing
    • Grid
    • Single Record
    • Export Options
    • Custom Grid
    • Custom Single Record
    • User Defined Styles
  • Image Management
    • Image Galleries
    • Thumbnails
    • Linked Images
    • Multi Upload - 1
    • Multi Upload - 2
    • Watermarks
  • Charts
    • Pie Chart
    • Column Chart
    • Bar Chart
    • Line Chart
    • Area Chart
    • Geo Charts
    • Stepped Area
    • Candlestick
    • Histogram
    • Bubble
    • Timeline
    • Gantt
    • Scatter
    • Tree Map
    • Multiple Charts
    • Chart Placement
    • Customizing Charts
    • Dashboard
  • Many-to-Many Relations
    • Classic Junction Table
    • Handling Extra Columns
  • Fine-tuning & Tweaking
    • Custom Icons
    • Custom Theme
    • Custom Editor
    • Page Embedding
    • Ajax-based Validation
    • Color Themes
    • Barcodes Generation
    • Inline Button
    • Conditional Details
    • Using Ajax in Forms
  • Emailing
    • Basic Usage
    • Advanced Usage
  • Calculated Columns
    • Example - 1
    • Example - 2
  • Custom Templates
    • Grid View
    • Card View
    • Grid Toolbar
    • Single Record View
    • Separate Page Editing
    • Modal Dialog Editing
    • Inline Form Editing
    • Wizard Form
    • Custom Filter - 1
    • Custom Filter - 2
    • Export & Print: Data Grid
    • Invoice generation
  1. Image Management
  2. Image Management.Watermarks
    • Image Galleries
    • Thumbnails
    • Linked Images
    • Multi Upload - 1
    • Multi Upload - 2

Image Management.Watermarks

Page settings

Appearance

Here you can select the number of cards to be placed in a row for each of supported screen resolutions. Your current resolution is highlighted in this way.

Page size

Total record count: 21.

page(s).
Cancel Save changes
×

Watermarks are visible embedded overlay on a digital photo consisting of text, a logo, or a copyright notice that discourages others from taking your digital images and using them without your permission.

In the example below this png image is used as a watermark for the iPhone photos.
To implement such a possibility, it is necessary to provide some event handlers. Technical details are as follows (click a link below to see the appropriate code):

  • OnBeforePageExecute event handler code.
  • OnCustomRenderColumn event handler code.
Refresh
Export
  • Export to Pdf
  • Export to Excel
  • Export to Word
  • Export to Xml
  • Export to Csv
Print
  • Print current page
  • Print all pages

    function getImageWithWatermark($imagePath, $watermarkPath) {
      list($sourceWidth, $sourceHeight) = getimagesize($imagePath);
      
      $resultImage = imagecreatetruecolor($sourceWidth, $sourceHeight);
      imagesavealpha($resultImage, true);
      $background = imagecolorallocatealpha($resultImage, 0, 0, 0, 127);
      imagefill($resultImage, 0, 0, $background);
    
      $sourceImage = imagecreatefrompng($imagePath);  
      imagecopy($resultImage, $sourceImage, 0, 0, 0, 0, $sourceWidth, $sourceHeight);
      
      $watermarkImage = imagecreatefrompng($watermarkPath);
      imagecopy($resultImage, $watermarkImage, 0, 0, 0, 0, imagesx($watermarkImage), imagesy($watermarkImage));
    
      ob_start();
      imagepng($resultImage);
      $imageData = ob_get_contents();
      ob_end_clean();
      
      return $imageData;
    }
        protected function doCustomRenderColumn($fieldName, $fieldData, $rowData, &$customText, &$handled)
        { 
            if ($fieldName == 'photo_large' && !empty($fieldData)) {
              $imagePath = sprintf('external_data/images/phone/iphone_large/%s', $fieldData);
              if (FileUtils::FileExists($imagePath)) {
                $watermarkPath = 'external_data/images/watermark.png';
                $imageData = base64_encode(getImageWithWatermark($imagePath, $watermarkPath));
                $src = 'data:image/png;base64,'.$imageData;
                $customText = str_replace($imagePath, $src, $customText);
                $handled = true;
              }
            }
        }

 
There are no records to display
Model Name Apple iPhone 12 Pro Max
Release Year 2020
Display Size 6.7
Colors Gold,Silver,Graphite,Pacific Blue
Photo