Variablendaten in einem JPG-Bild

Hallo,

Ich habe einen jpg-bild im webfront geladen.
Nun möchte ich in diesem bild life daten zeigen wie statussen und temp.
Ist das in webfront möglich?

Mit freundlichen Grüßen,
Wouter

Ich vermute, es wird einfacher sein zu Wissen, wenn du auf Englisch schreibst. So richtig weiß ich nicht, was du machen möchtest.

Ich habe den Titel angepasst… Ist das so korrekt, was du tun möchtest?

paresy

Hi wouter

If I understand you right you are searching for something which is actually dicoussed in this thread:

best rgds
bb

hello,

What I want to make is the following:
I have a picture of my collector system in web front.
Now I will show the current values ​​of the temperature sensors in this picture.

with greets,
Wouter

Have a look here: http://www.php.net/manual/en/ref.image.php

You can modify your picture anyway you want. If you want to use some overlay technique than you should have a look a bbernhard’s topic.

paresy

You can try this Script

	$imagefile1 = "C:\	mp\\image_org.jpg" ;
	$imagefile2 = "C:\	mp\\image_new.jpg" ;

	$image = ImageCreateFromJPEG($imagefile1);

	$black = imagecolorallocate($image, 0, 0, 0);      // Black

	$x = 10;    // Position
	$y = 10;    // Position
	imagestring($image, 3, $x, $y, "Die aktuelle Uhrzeit:", $black);
	$y+=20;     // Second Line
	imagestring($image, 3, $x, $y, date("d.m.Y H:i:s", time()), $black);
	imagejpeg($image,$imagefile2);      // Save Image
	imagedestroy($image);

image_new.jpg

image_org.jpg

Wie kann man da die Schriftart und Größe ändern?
Hab leider von PHP keine Ahnung.

http://php.net/manual/de/function.imagestring.php
Die 3 gibt einen internen Font an. Moeglich sind 1-5 .
Um flexibler zu sein kann man folgendes benutzen.
http://de.php.net/manual/de/function.imagettftext.php

	$imagefile1 = "C:\	mp\\image_org.jpg" ;
	$imagefile2 = "C:\	mp\\image_new.jpg" ;
	$font 		= "C:\	mp\\BRITANIC.ttf" ;

	$image = ImageCreateFromJPEG($imagefile1);

	$black = imagecolorallocate($image, 0, 0, 0);      // Black

        // TExtgroesse = 40
        // Winkel 90 Grad
        // Font BRITANIC
   ImageTTFText ($image, 40,90, 40, 120, $black, $font,"Test");
	imagejpeg($image,$imagefile2);      // Save Image
	imagedestroy($image);

image_new.jpg