4D Blog

Home Product Support of pictures in Objects

Support of pictures in Objects

July 20, 2017

Product Picture attribute in 4D object

From 4D v16 R4, we have added the support of pictures in object attributes. For example, if you use an object to exchange settings or data between methods, forms or processes, now, you can also pass an icon or a picture in this object. You don’t need anymore to temporarily save the picture on disk.

This new type can be used like any other object attribute type: you can use, get and set pictures in objects. You can also use the controls of the picture theme.

Example database

Another use cases for this feature is what we call “User Fields” where the field content can be different for a user to another user. For example, you can create a “contact” object. Each user can decide whether he wants to save the “first name”, “last name”, “ID“, “address“, “country“, “gender” information, and so on. Now your users can also save a picture for their contact, easy!

Handling an object attribute

 To set a picture in an object attribute, you can write:

C_OBJECT($obj)
C_PICTURE($Picture)
READ PICTURE FILE("...\Images\avatar.jpg";$Picture)
OB SET($obj;"avatar";$Picture)

 To retrieve a picture attribute in a picture variable, you can write:

C_PICTURE($Avatar)
$Avatar:=OB Get($obj;"avatar")

Manipulating an image

You can use a picture attribute in all the commands of the “Picture” theme. For example:

PICTURE TO BLOB(OB Get($obj;"avatar");$blob;"image/jpeg")

Documentation

For more details, please refer to the following articles in the documentation:

  • OB Get
  • OB SET
  • OB GET ARRAY
  • OB SET ARRAY
Discuss

Tags Objects, Pictures, v16 R4, v17

Latest related posts

  • July 18, 2025

    Embed deployment license automatically into your applications

  • July 17, 2025

    New Class to Perform UDP Communications

  • July 17, 2025

    Managing Calendar Events with Microsoft 365 or Google in 4D: Create, Update, Delete

Vanessa Talbot
Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R9 20 R10 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R9 20 R10 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy