• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create thumbnail on canvas?

#1
[eluser]ChristiaanT[/eluser]
Hello,

I am wondering if it's possible to create a thumbnail on a blank fixed-sized canvas. I need this to get a perfect image with vertical centering too. So for example I want a thumbnail that has a fixed width and height of 200 x 200px. I wan't to create that blank canvas using GD and then 'place' an image in the center/center of that canvas. Is this possible using the image_lib? I looked around, but can't find a solution here in this forums. Now I hope you can help me.

Thanks for your help.

#2
[eluser]ChristiaanT[/eluser]
I already solved this problem with PHP in combination with CSS margin-top. I used PHPs getimagesize() to get the image height, then use a negative top margin from half the height. Also you have to position the image relative with set css top at 50%.

I hope I gave someone an idea with sort-a-like problem...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.