Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
Sichere ProgrammierungVisual Studio Code 1.141 (Insiders)(07.10.2026 um 19:00 Uhr)
•
Linux Tipps & Hardening[$] Comparing Chromium development at Google and Igalia(30.09.2026 um 16:16 Uhr)
•
Sichere ProgrammierungReports from the 2026 Python Language Summit(30.09.2026 um 16:32 Uhr)
•
KI & AI VideosJulian Goldie SEO: NEW LongCat Preview Just Dropped! 🔥(30.09.2026 um 16:00 Uhr)
•
Linux Tipps & HardeningA unified OS installer in systemd (asg2026)(30.09.2026 um 00:00 Uhr)
•
Windows Tipps & SecurityContainers without a new runtime: sdme on systemd-nspawn (asg2026)(30.09.2026 um 00:00 Uhr)
•
Linux Tipps & Hardeningsingle-file containers with statically linked systemd (asg2026)(30.09.2026 um 00:00 Uhr)
•
Linux Tipps & HardeningForget "podman generate systemd": How Quadlet Really Works (asg2026)(30.09.2026 um 00:00 Uhr)
•
IT Security VideoLiveOverflow: Why Old Threat Models Are Dead #shorts(30.09.2026 um 15:55 Uhr)
••
Sichere ProgrammierungVisual Studio Code 1.141 (Insiders)(07.10.2026 um 19:00 Uhr)
•
Linux Tipps & Hardening[$] Comparing Chromium development at Google and Igalia(30.09.2026 um 16:16 Uhr)
•
Sichere ProgrammierungReports from the 2026 Python Language Summit(30.09.2026 um 16:32 Uhr)
•
KI & AI VideosJulian Goldie SEO: NEW LongCat Preview Just Dropped! 🔥(30.09.2026 um 16:00 Uhr)
•
Linux Tipps & HardeningA unified OS installer in systemd (asg2026)(30.09.2026 um 00:00 Uhr)
•
Windows Tipps & SecurityContainers without a new runtime: sdme on systemd-nspawn (asg2026)(30.09.2026 um 00:00 Uhr)
•
Linux Tipps & Hardeningsingle-file containers with statically linked systemd (asg2026)(30.09.2026 um 00:00 Uhr)
•
Linux Tipps & HardeningForget "podman generate systemd": How Quadlet Really Works (asg2026)(30.09.2026 um 00:00 Uhr)
•
IT Security VideoLiveOverflow: Why Old Threat Models Are Dead #shorts(30.09.2026 um 15:55 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Uniface 101: A Look at the image Data Type 🖼️

Hey everyone! 👋 If you're working with Uniface, you'll eventually need to handle images. Whether it's a user's profile picture or a product photo, knowing the right way to store and manage this data is key. Let's dive into one of Uniface's …

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hey everyone! 👋 If you're working with Uniface, you'll eventually need to handle images. Whether it's a user's profile picture or a product photo, knowing the right way to store and manage this data is key. Let's dive into one of Uniface's fundamental data types for this job: image.



Just a quick note: This blog post was put together with the help of an AI assistant to break down the official Uniface documentation into a more digestible format. 🤖






What is the image Data Type?



In simple terms, the image data type in Uniface is a container for binary data. While its name suggests it's only for pictures, it's really about holding any kind of binary information. Think of it as a special box for data that isn't simple text or numbers.



You would typically use it to handle images from various sources, such as:




  • 🖼️ Images stored directly in a database.

  • 📁 Glyphs or icons used in your application's UI.

  • 💾 Image files loaded from a disk (like a .jpg or .png).

  • 🧩 Data from third-party filters that output binary image data.






How Do You Use It?



In your Uniface application, you can declare variables or parameters with the image data type within a ProcScript block. This is done in the variables or params section of your script.



Here’s a simple example of how you might declare an image variable and load a picture into it from a file:





variables
image v_user_avatar
endvariables

; ProcScript to load an image from a local file into our variable
read_image v_user_avatar, "C:\temp\avatar.png"

; Now you can use the v_user_avatar variable, for example,
; to assign it to an image widget in your form.
$widget("AVATAR_WIDGET") = v_user_avatar






In this snippet, v_user_avatar is now holding the binary data of the avatar.png file, ready to be displayed or processed further.






Important Rules to Remember 🧐



Working with the image data type comes with a couple of important rules that can save you from headaches later.






1. No Math! 🧮



You cannot perform arithmetic operations on image data. It might sound obvious, but it's worth remembering. Trying to add, subtract, or multiply two images together just doesn't make sense and isn't allowed.






2. The Big Gotcha: Comparing Images 🤔



This is the most critical point. You cannot directly compare two image variables to see if they are identical.



For example, this code will always be true, even if the images are different!





if (v_image1 == v_image2)
; This block will ALWAYS execute, which is not what you want!
endif






The correct way to check if two images are the same is to calculate a hash for each one and then compare the hashes. A hash is like a unique fingerprint for data. If the fingerprints match, the data is identical.



Here’s a conceptual example:





variables
string v_hash1, v_hash2
image v_image1, v_image2
endvariables

; ... imagine v_image1 and v_image2 are loaded with image data ...

; Calculate a SHA256 hash for each image
v_hash1 = $$hash(v_image1, "SHA256")
v_hash2 = $$hash(v_image2, "SHA256")

; Now, compare the string hashes
if (v_hash1 == v_hash2)
message "The images are identical! ✅"
else
message "The images are different. ❌"
endif









Conclusion



The image data type is your go-to for handling binary image data in Uniface. Just remember to declare it, load your data, and be very careful when comparing two images—always use a hash! ✨



Happy coding!

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Uniface 101: A Look at the image Data Type 🖼️

Thematisch verwandte Begriffe: Uniface, Look, image, Data · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-82307 | Improper neutralization of special elements used in an SQL command ('SQL…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag