הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   יצירת רקע שקוף ב PHP (https://hosts.co.il/forums/showthread.php?t=24185)

eLad 17-06-06 10:13

יצירת רקע שקוף ב PHP
 
אהלן

יש לי תמונה של עיגול נניח שמקיף אותו ריבוע.
אני מעוניין שהעיגול יצבע בצבע שמקבל העמוד כפרמטר (page.php?color=000000) והריבוע יהיה שקוף. איך עושים את זה? :)

-VladK- 17-06-06 11:04

אתה בודק בעזרת הGET מה הערך של COLOR ואז מדפיס את זה....
PHP קוד:

<?php
$color 
$_GET['color'];
?>
<img src="images/block<? $color?>">


eLad 17-06-06 11:07

ציטוט:

נכתב במקור על ידי CriSis
אתה בודק בעזרת הGET מה הערך של COLOR ואז מדפיס את זה....
PHP קוד:

<?php
$color 
$_GET['color'];
?>
<img src="images/block<? $color?>">


אה?

mlnn 17-06-06 11:11

קוד:

<?php

// example4.php

// set the HTTP header type to PNG
header("Content-type: image/png");

// set the width and height of the new image in pixels
$width = 350;
$height = 360;

// create a pointer to a new true colour image
$im = ImageCreateTrueColor($width, $height);

// switch on image antialising if it is available
ImageAntiAlias($im, true);

// sets background to white
$white = ImageColorAllocate($im, 255, 255, 255);
ImageFillToBorder($im, 0, 0, $white, $white);

// define black and blue colours
$black = ImageColorAllocate($im, 0, 0, 0);
$blue = ImageColorAllocate($im, 0, 0, 255);

// draw an empty circle
ImageEllipse($im, 180, 100, 100, 100, $black);

// draw a filled ellipse
ImageFilledEllipse($im, 180, 220, 150, 50, $blue);

// send the new PNG image to the browser
ImagePNG($im);

// destroy the reference pointer to the image in memory to free up resources
ImageDestroy($im);

?>

View Example 4

To draw a circle or an ellipse, we use the same ImageEllipse function. The parameters provided to this function are: image resource, center x, center y, width, height, colour. As you can see from the above example, all you need to do to draw a circle rather than an ellipse is to set the width and height to the same value.

מקור:
http://www.design-ireland.net/index....imagery-15.php

-VladK- 17-06-06 11:28

לא ידעתי שהוא רצה את זה בGD...

eLad 17-06-06 14:52

תודה mlnn אך לא זו הייתה הכוונה שלי.

נשאל בצורה אחרת - איך יוצרים רקע שקוף בעזרת GD??

-VladK- 17-06-06 14:57

אהההההם תנסה לשים תמונה שהיא עם רקע שקוף...תמונה GIF (כמו שהפוטושופ יוצר)

eLad 17-06-06 16:16

ציטוט:

נכתב במקור על ידי CriSis
אהההההם תנסה לשים תמונה שהיא עם רקע שקוף...תמונה GIF (כמו שהפוטושופ יוצר)

שקוף על לבן זה לבן.. לא עוזר לי |Rolleyes|

-VladK- 17-06-06 16:18

אז מה אתה צריך? אני לא מבין אותך! אתה אומר איך לעשות שקוף...אני נותן לך שקוף...מה עוד אתה רוצה?

null 17-06-06 16:36

תנסה, תבדוק שזה עובד ותביא לו.
אל תזרוק שטויות לאוויר :)


כל הזמנים הם GMT +2. הזמן כעת הוא 21:54.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ