Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
$thumb_groesse = 0.3;
$im_src = imagecreatefromjpeg ( $bild );
$size = getimagesize ( $bild );
$breite = $size[0];
$hoehe = $size[1];
$thumb_breite=$breite*$thumb_groesse;
$thumb_hoehe =$hoehe*$thumb_groesse;
$im_des = imagecreate ( $thumb_breite, $thumb_hoehe );
$white = ImageColorAllocate($im_des, 0xFF, 0xFF, 0xFF);
$black = ImageColorAllocate($im_des, 0x00, 0x00, 0x00);
imagecopyresized ( $im_des, $im_src, 0, 0,0,0, $thumb_breite,$thumb_hoehe,$breite,$hoehe );
$font = $_SERVER["DOCUMENT_ROOT"] . "/test/verdana.ttf";
ImageTTFText($im_des, 40, 0, 20, $thumb_hoehe-25, $white, $font, "(C)Bernhard-Stuben.de 2003");
imagejpeg ( $im_des,'',50);
imagedestroy ( $im_des );
imagedestroy ( $im_src );
If you are getting an error when using ImageCopy(), be sure that both images are of the same type - either True Color or Palette.
GD 1.x can copy images of different types, but with GD 2.0 this will cause an error.
Note that ImageCreateFromJPEG always creates a True Color Image.
You can use ImageCreateTrueColor() instead of Image Create() to solve this problem.