 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
03-13-2008, 05:42 AM
|
#1 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Gd images
How would I get images to stay in the imagecreatetruecolor, so I don't have to see the black?
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
03-13-2008, 10:00 AM
|
#2 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
Please provide a less obscure description of your problem...
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|
03-13-2008, 11:07 AM
|
#3 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by xenon
Please provide a less obscure description of your problem...
|
How would I have the width and height set to where it fits the image color, using imagecreatetruecolor, the background is black, and no matter how much I try when using imagecopyresampled, it will show the background imagecreatetruecolor
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
03-13-2008, 11:49 AM
|
#4 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
|
imagecreatetruecolor() returns an image identifier representing a black image of the specified size.
in order to change the background colour you can use the following script.
PHP Code:
$bg = imagecolorallocate($im, 233, 14, 91);
Place right after the imagecreatetruecolor()
|
|
|
03-13-2008, 03:06 PM
|
#5 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Rendair
imagecreatetruecolor() returns an image identifier representing a black image of the specified size.
in order to change the background colour you can use the following script.
PHP Code:
$bg = imagecolorallocate($im, 233, 14, 91);
Place right after the imagecreatetruecolor()
|
I know that, but you don't get what Im saying.. I mean Im getting the image from a database. And I hate black backgrounds showing up, ya know, so yeah.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
03-13-2008, 03:11 PM
|
#6 (permalink)
|
|
The Addict
Join Date: Nov 2007
Posts: 282
Thanks: 61
|
I'm guessing your trying to do transparency images?
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
|
|
|
|
03-13-2008, 04:41 PM
|
#7 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Nor
I'm guessing your trying to do transparency images?
|
imagesavealpha, yes yes, I know but.. Hmm? Would that work?
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
03-13-2008, 05:10 PM
|
#8 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
|
Quote:
Originally Posted by Orc
I know that, but you don't get what Im saying.. I mean Im getting the image from a database. And I hate black backgrounds showing up, ya know, so yeah.
|
You dont need to be rude about it i am sorry if you are not very clear on what exactly you want
|
|
|
03-13-2008, 05:14 PM
|
#9 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
How about giving everyone a visual example (starting images [yes, from the database], resulting images [with black backgrounds] and the appropriate code you're using [or all of it])?
|
|
|
|
03-13-2008, 05:49 PM
|
#10 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Sorry Rendair, hang on, lemme try to make it better..
Say that the black was the imagecreatetruecolor width and height, when cropping images, it does this to me, when just resizing it, its fix, how would I get this? Say, to a certain point of which the image width ends, I dont want imagecreatetruecolor width's black, I would it to be stopped, how would I do this?
Or shall I delete this thread, and figure it out myself? I don't know what else to say. :/
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
03-13-2008, 11:21 PM
|
#11 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
Well, I'd suggest you calculate the thumbnail dimensions BEFORE creating the virtual image to store the thumb into. Then, you wouldn't have problems with imagecopyresampled. If the image has some transparent pixels around it, run a function on the image to see where is the image ending ( imagecolorat).
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|
03-13-2008, 11:23 PM
|
#12 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by xenon
Well, I'd suggest you calculate the thumbnail dimensions BEFORE creating the virtual image to store the thumb into. Then, you wouldn't have problems with imagecopyresampled. If the image has some transparent pixels around it, run a function on the image to see where is the image ending ( imagecolorat).
|
I have done that. I took the width and height and list() them and then put them in the database like so 000x000, then I went and explode() the x and made $foo[0] and $foo[1] thus gave me the width and height.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
03-14-2008, 03:48 AM
|
#13 (permalink)
|
|
The Addict
Join Date: Nov 2007
Posts: 282
Thanks: 61
|
Mind posting your code :D & db table example
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|