Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Create Or Resize Transparent .png - Drop Shadow - GD IM


I've searched and d/l'd but cant seem to find a way of creating
a semi-transparent drop shadow for an image.

Let me say, be fore I go on, I *do not* want one of those scripts that
resizes your image a bit to the left and bottom, and then grafts a
shadow onto it. I want to use a full shadow (it would be about as big
as the image) and shift it a bit with CSS. So, I will have the image
sitting in a DIV which will have the shadow as a bg. This works fine
doing it manually.

So, I would like to find one of two alternatives:

1. (best) Create the shadow from given parameters(size, darkness,
spread, etc.) I will write the .png to a folder, I dont really need to
create it dynamically each time, but want the ability for the future
(galleries) and for when I'm in development and images are changing,
moving around, etc.

2. (will work) Take a pre-existing shadow and resize it as needed, but
has to keep the transparency.




View Complete Forum Thread with Replies

Related Forum Messages:
Resize Transparent PNG
I have a basic script to resize a transparent png image. Code:

$dimg = imagecreatetruecolor($newwidth, $newheight);
imagecolortransparent($dimg, imagecolorallocate($dimg,0,0,0));
imagealphablending($dimg, false);
imagecopyresampled($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight);


Problem is that my nice drop shadows are lost in resize. Does anyone know how I can keep them ?

View Replies !
GIF Resize Resample Transparent Fill
I am currently trying to create what I would think is simple. I want to create a image.php file and have it resize a 80 x 80 image to 29 x 29 with out losing the quality. When I try to have the gif image imagefill with the color white (255,255,255) it holds up and ends with a timeout. The gif images also have the black pixels if i don't try filling.

Does anyone know a simple script to just resize a gif/jpg file? All documentation has been pretty bad so this is first time posting.

View Replies !
PHP (GD) Created Transparent PNG: AlphaImageLoader Makes Black Parts Transparent Instead Of Transparent Color Set With PHP
I have a problem with PHP (GD) created transparent PNG and Microsofts
AlphaImageLoader.

You will immediately see what the problem is if you view
http://www.useful-scripts.biz/test/.../transpng_2.php with IE 7
or Firefox and then with IE 6. It seems that the AlphaImageLoader
works correctly on a PNG image that has been created with an image
processor and then uploaded, but not with a PNG image created with
PHP. It seems to ignore the transparent color set with PHP and instead
to render the black color transparent.

The image in question was created using this code:

<?php
$source = imagecreatefrompng("parrot_orig.png");
$transp = imagecolorallocate($source,255,0,0);
imagecolortransparent($source,$transp);
imagefilledrectangle($source,15,15,70,70,$transp);
imagepng($source,"parrot_php.png");
?>

The HTML used on the page is this:

View Replies !
Shadow On Image
This works well now, only problem is the shadow is just black only! what can i do to make it more like a shadow. PHP Code:

<?php
$filename = "http://www.mysite.com/travel/$folder/$pname";

/// START RESIZE
$off_site = $filename;  
$fp = fopen ($off_site, 'rb') or die('Unable to open file '.$off_site.' for reading');  
$buf = ''
while (!feof ($fp))  
{  
$buf .= fgets($fp, 4096);  
}  

header('Content-Type: image/jpeg');
$data = $buf;
.....................

View Replies !
Image Upload, Resize, Rename And Create Record In Mysql
I have limited knowledge in php and I am having trouble with uploading
an image to a remote directory and resizing it if it's larger and
renaming it to a unique id, while at the same time I would like to
create a record in mysql database. I've tried to find some tutorials
but I've had trouble finding any good ones. Wondering if anybody has
good examples or link to a good tutorial.

View Replies !
Create An Auto Drop Down Box
I need to create an auto drop down box. For example I already have a list of states that are pulled from the database. When the user selects a state, a drop down box below should populate with the cities from that state. (that's where I'm having trouble)

This is a search form so the results have to reflect what city and state they chose. (along with some other criteria)

I've searched all evening for instructions on how to do this and so far I've only seen javascript that you put directly in the code. If I have all 50 states along with their related cities that's an awful lot of code to put in the page.

Isn't there a way to automatically pull the cities from the database to populate the box when the user clicks a state? I have no idea where to start to make that work.

View Replies !
Re-create A Drop-down Menu
I have 2 drop-down menus (1) States (2) Shows By State. how do I invoke a re-build of the Shows By State drop-down when the user requests a different state. I believe this has to be done with Javascript and I don't know Javascript. Could someone supply a small example of how this is done? I am using PHP and MySQL. Following is the PHP code for building the state drop-down menu:

<tr><td bgcolor="#EFC891" width="496" align="left"><b>Select a Show in Your
State:&nbsp;&nbsp;

<select name="ShowState" >
<?php
$stateName=getStateName();
$stateCode=getStateCode();
for ($n=1;$n<=50;$n++)
{
$state=$stateName[$n];
$scode=$stateCode[$n];
echo "<option value='$scode'";
..............

View Replies !
How Do You Create Sub Drop Down Menu?
I have been wanting to create this for my site but i am not sure how. I would appreciate if anyone could show me some example code of how it's done.

What want to do is basically, say there are 2 drop down menus on my site, one for country and one for region. Say in the country menu you select UK, i would like all the regions in the UK to show up only, and if you select another country, only the regions in that particular country will show up. I am sure you understand what i mean. I would be very grateful if someone could show us how this is done.

View Replies !
Drop Box To Create Other Objects
I am attempting to create a mail form where several inputs will change depending on the user's selection on an initial drop box. I've been trying to use the OnFocus= command but I am not familiar with java. Code:

View Replies !
Create A Drop Down Form
I'm supposed to create a site that allows users to response to online questions. In particular, I was asked to create a reply button at the end of each question so that when users click the reply button, it will automatically drop down a form (instead of linking to another page) that allows them to type in their response and click the submit button. The information is supposed to be sent through email.

View Replies !
Create Drop Down Select With Say Five Different Options
For the form I need to create drop down select with say five different options. There also should be possibility to enter own option if one is not listed. How can I do it.?

View Replies !
Create A Drop Down List That Has Say 15 Options.
what I would like to do is create a drop down list that has say 15 options. Each option will take you to a different URL when selected. Does anyone know of a good script that would do this?

View Replies !
Drop Down Boxes To Create Text Fields
I need a script that will create text boxes from a drop down box. So If I choose 6 from the drop down box and "enter family details" I want 6 text boxes to be created in my form on the next page....

View Replies !
Need To Create Drop Down Box With Data Pulled From Text File
Trying to make a drop down box like this example:

Dog
Cat
Bird

But sometimes I will need to update it...and add/remove names from the list. I want to do it fast and easy and I don't want to use a MySQL Database. I'd rather use a text file...can that be done? I would keep the info in a text file and then push it to a drop down box via php and html.

View Replies !
How To Create The Form Boxes And Drop Down Boxes
Im going to create a php form that allows someone to signup to my web hosting site, once they have filled in all the relevant parts and the have selected the hosting package they want and hit the submit button.

i want the form to take them to a correct webpage that will allow them to pay for the package that they have selected on the form. I know how to create the form boxes and drop down boxes but i dont know the correct coding to pick up package variableon the last drop down box .

View Replies !
Transparent GIF
I am trying to resize transparent GIF images, so I was reading, and they say to use fopen, fread, and read the first 13 bytes... OK, so I read in a transparent gif, and the first 13 bytes... and echo it out to the screen, and I get this: GIF89a›&#65533;s&#65533;÷&#65533;&#65533;What am I supposed to do with that? they then say "allocate that color as transparent, and use imagecopy(); to set the transparency back."

View Replies !
Transparent .png
This isn't totally related to php, but I am using a php generated page that is using transparent .png's.

Anyway, when I view the page in Internet Explorer, the transparency within the png is replaced with grey?? But when I view it in Firefox it works fine?

View Replies !
Transparent Image
Hi!

Here's a piece of code:

[begin]

<?php

Header('Content-type: image/png');

$sz = "";

$FileValue = 1000;

$i = strlen($FileValue);

for ( $j = 0; $j < 7-$i; $j++ )
{
$sz = $sz . "0";
}

$Img = imagecreate(56,13);

$Gold = imagecolorallocate($Img,148,128,100);

$Gray = imagecolorallocate($Img,32,32,32);

ImageFilledRectangle($Img,0,0,55,12,$Gray);

imagestring($Img,4,0,0,$sz.$FileValue,$Gold);

imagepng($Img);

ImageDestroy($Img);
?>

[end]

OK. Calling this script I have a png picture back.

Now I add imagecolortransparent($Img,$Gray); just before imagepng() and OK
again, I have a transparent picture back. But now, if I add:

$r = imagerotate($Img,90,0);

imagepng($r);

just after the imagecolortransparent() instruction seen above, I get a
rotated picture, but not transparent. How to solve that? I've used a plenty
of tricks, no one works.

View Replies !
Transparent GD Watermark.
Any one know what would be the best way to accomplish a transparent watermark on upload with GD that will work for Jpegs, Gifs and Pngs,  using only GD in php 4?

View Replies !
Transparent Background
i'll try to explain myself the best i can, here is the problem:

i have a html page and inside this i want to put an iframe that contains a php page. That's ok, i can do it and it works, but the problem is that i can't make that php document to have transparent background.

it turns white. Is it because of the iframe? the php document has transparent background, but when i see it inside the iframe it doesn't work.

View Replies !
Two Transparent Colours
I have an image that I am opening and then merging onto another image, and it has two colours which I wish to make transparent, but it is not working, can you please give me an example of how to do this thanks. When I say that it is not working, I mean that when I allocate the second one, the first one is no longer transparent.

View Replies !
Transparent Overlay Watermark - On The Fly?
Is it possible to overlay a transparent watermark on an image -
dynamically?

I'd like the result to look like this example:
<http://www.cycletourist.com/temp/photo.php>

That is a bit of overkill, but you can see what I mean. The watermark
image (a png image) is included separately below the photo.

I tried using a class from phpclasses.org
<http://www.phpclasses.org/browse/package/1580.html...
but the result looks horrible. The transparency does not work.

I found one other method through Google,
<http://www.sitepoint.com/article/watermark-images-php>
but it did not work, either.

Can this kind of transparent overlay be done on the fly with GD lib?

View Replies !
Dynamically Transparent Gif's
Basically what i would like to do is dynamically set the transparency of a selection of images (GIF'S) depending on variables set in a My SQL Database. What i need to do is tint some jpg,s by setting the transparency of a solid blue gif which is set over the top of it in a table.

View Replies !
GD: Testing A Pixle To See If It's Transparent?
How would I determine if a pixel is 100% transparent on a given image?

View Replies !
Imagegettftext Transparent Holes
I created an image, made it transparent, drew a rounded rectangle on it and then wrote on it with imagegettftext - where the text is there are transparent holes.

$image = imageCreateTrueColor($width,$height);
imageSaveAlpha($image, true);
ImageAlphaBlending($image, false);

$transparentColor = imagecolorallocatealpha($image, 255-$r, 255-$g, 255-$b, 127);
imagefill($image, 0, 0, $transparentColor);

$background = imagecolorallocate($image, $br, $bg, $bb); .......

View Replies !
Find Out If An Image Is A Transparent Gif
Does anybody know if there's an easy way to find out if a given image is a transparent gif? (GIF89a)

View Replies !
Define The Transparent Color
I've made a script that takes images (in gif,jpg & png) and makes their thumbs in jpg format. Now, the problem is if I have a transparent gif when saved to jpg the part of the original picture that is transparent turns black in the new thumb. My question is: how can I define that the transparent part gets the color i want it to get (white is what i need) ?

Actually, I now what in theory should be done. I should change the r,g,b values of the color that has aplha=127 (and that's not a problem with imagecolorset()), but also I should change the alpha of that color to 0. how can that be done ? My quess is that that is the right way to do it.

View Replies !
Transparent Watermarks On Images
I'm using the code below to make a watermark and it's kinda working, but I want it semi-transparent as the PNG file is itself.

Is there an easy way of overlaying transparent images in the GD library, so that the original image is merged in such as way that it can be seen through the watermark? Code:

View Replies !
Make Thumbnail Transparent
I have a script that will upload an image, then create a thumbnail of that image. When I upload an image with a transparent background the normal sized image comes out with a transparent background, but the thumbnail image comes out with a black background. Code:

View Replies !
Transparent Text On Image?
Is it possible to place transparent text on an image? I want to display an image of some text in a fancy typeface, but superimpose text in a plain style, so that it can be copied and pasted; a bit like what you see in some PDF files, where the page image is visiable, the overlying text is not.

View Replies !
Transparent Filled Polygon
I'm working on a map program where each building is clickable and when it's clicked the page is refreshed to show a map with the building highlighted (in red). I was wondering if it would be possible to highlight the buildings using some sort of combination of the imagepolygonfill function and a transparency function (i'd like the buildings to still be visible under the highlight), rather than having to create many different files with the different buildings highlighted.

View Replies !
Make A Colour Transparent
I would like to do is grab an image, determine what colour is at a certain pixel (maybe 10, 10) and then set that colour to transparent for the whole image. Basically it is so that I can dynamically place an image on various backgrounds for previewing. I am not worried about perfection (anit-aliasing, matte, etc).

View Replies !
Add Transparent Copyright Text To Image
I need a way to add a transparent copyright message (e.g. copyright 2002 together with my company logo) to my photos on the fly. My photos come in many different formats, such as PNG, GIF and JPEG.

View Replies !
.htaccess Transparent SESHID And Sessions
just putting the finishing touches on a shopping site and have run into errors in the process when users are blocking cookies. i am using:

<IfModule mod_php4.c>
php_value session.use_trans_sid 0
</IfModule>

in my .htacess file to supress the PHPSESSID=22y3213etc. but it means that if a cookie isn't set the site fails to work properly.

if i remove that from my .htaccess the site works fine because the PHPSESSID is passed around evey page, but it knackers things for SEO purposes. Code:

View Replies !
How Do I Change The Drop Down List So The Option Selected Last Time Is Then The Current One Shown In The Drop Down Box?
I have a drop down list with the town options 'Bury' and 'Ipswich' as
shown below.

When selecting one of the options, its value is passed to variable
$townsearch.

How do I change the drop down list so the option selected last time is
then the current one shown in the drop down box?

<body>

<?php $townsearch = $_get['town']; ?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">

<select size="1" name="town">

<option>ipswich</option>
<option>bury</option>
&nbsp;
</select>&nbsp;

<input type="submit" value="GO" />

</form>

View Replies !
How Do I Echo A Binary Array (transparent Pixel)
What am I doing wrong here? I want to display a transparent pixel...

<?
$transparent1x1 = array (71, 73, 70, 56, 57, 97, 1, 0, 1, 0, -128, 0,
0, 0, 0, 0, 0, 0, 0, 33, -7, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0,
1, 0, 0, 2, 2, 68, 1, 0, 59);
header("Content-type: " . image_type_to_mime_type (IMAGETYPE_GIF));
echo $transparent1x1;
?>

View Replies !
[GD]: Open Existing Image(url) & Set A Transparent Color
lets say i output an image like this:

$img = array('somedomain.com/foo.jpg');

<img src="$img[0]" alt="" />

but it has a white background and i want to strip the white background to be transparent

how do i do that and output it inline again?

View Replies !
Remove A Black Background From An Image To Make It Transparent Using GD
is it possible to remove a black background from an image to make it transparent using GD. for example. can i pass the radius of the moon to GD (as it is on the image) and have it slice the moon out so to speak leaving it on a transparent background.

View Replies !
Drop Down Lists Changing Depending On Other Drop Downs
I want to have a drop down system like this one.  But without the radio buttons.

I want to have 3 drop downs but have no idea how to go about it.  I assume I will need to activate some sort of Javascript on the onChange event of the option drop downs.

View Replies !
Security - Detect If A Client Is Connecting Through A Proxy(inluding Transparent) Or Not.
I want to detect if a client is connecting through a proxy(inluding transparent) or not.  What measures can I take to authenticat the source of the request before I even ask for login details. $_SERVER['REMOTE_ADDRESS'] is the only thing I can think of using but surely it is not sufficient to trust its value.

View Replies !
Put Transparent Layer That Disable Page Element At The Time Of Processing Ajax
I have made web page in php with the help of ajax and javascript. I want to do whenever page processing for ajax for that time I want to put some transperent layer that will disable the back pages element.. I have seen one site but I dont remember.

View Replies !
Drop Down 2 Echo Seletion On Drop Down 1
I would like to put up a list/menu drop down so when you select something it echo's something in the second drop down.

Example

Drop menu 1
-----------------------
course 1
course 2

Drop menu 2
-------------------
If course 1 echo course 1 dates.
If course 2 echo course 2 dates

Does anyone have an example for me or what do I need to search for cause I don't quit know what it is called and thus I cannot find anything on Google.

View Replies !
Creating Image From Uploaded Image And Transparent PNG
Say the client wants to be able to change the image, but not the text treatment, and doesn't have the Photoshop knowledge to actually replace it and re-save it themself.

Is there anyway to use a PNG with the rounded edges, text treatment, and transparent center, have the client upload a standard rectangular-shaped image, and use PHP to layer the uploaded image underneath the transparent one, creating a new image file?

View Replies !
Resize BMP
Is there any function to resize bmp images ..

View Replies !
Resize Pic
I'm looking for a script that will echo the resized image, but not actually resizing the actual image on the database. Code:

View Replies !
Using GD To Resize
I've tried several ways to write this script and everytime no file is written. I've double-checked and GD is installed and enabled and the permissions on the write folder are okay.

All this should do is take a file that is uploaded and resize it to a width of 230pixels and save it (the file upload works fine, tested and proven.) Code:

View Replies !
Resize Images On The Fly
I am trying to resize images on the fly.

View Replies !
(Image Resize)
I have attempted to have a go at image resizing myself but I'm struggling and want to know why I get the result I do with the script I have. PHP Code:

View Replies !
Resize Image ?
Is it possible to resize an image before placing it on the page?? I am transferring data from a csv file onto a page as per this thread http://forums.devshed.com/t56265/s.html[/URL] . The image names in the column in the csv file are being used to place the relevant images on the page.

However, the images are of various sizes. Is there a way to check the width, and if it does not meet a specific size, then resize it (preferable with constraints on i.e. height to be resized correspondingly) to a specified width, and then place it on the page ?

View Replies !
Is It Possible To Do This? (resize Image From Url Only)
I am struggling to create a PHP function that would take a specified
image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail
so it will always fit in a 200x250 space. I am hoping not to have it
inserted or read from a database to do this function.

View Replies !
Image Resize?
my website gets alot of user submitted photos. i just made a quick script that has all of there information put into a database. just basic stuff, id, name, location, description and date submitted.

and the images that they submit are being called by 1.jpg and 1-thumb.jpg. anywhoo when i add there information i want to be able to upload the image that they sent and have it resized twice. once for 200 wide and however tall and another one for 400 wide and however tall. i went looking on google and didn't find much information about this.

i am on pretty much dedicated server, so i could install anything if needed. freebsd. because i would much rather be playing quake than having to open up photoshop and resizing the images. i just want to know if this is possible.

View Replies !
With Codes - Need To Resize
Hi, I am having problems resizing a text. What is wrong with the
script?

<td><size=6>For payment information, please contact us at (021) 221100
or at <a href="mailto:info@altha.com">info@altha.com</a></size></td>

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved