Now that I've moved from web to other coding languages, I've come across Vista's sidebar and how to make gadgets for them. I am having a problem though. I am making a apache + mysql pinger for my server, it's working well but I can't align the image to the top corner. See an example here:
http://clan-ik.frih.net/bserver/test.html
It's right in the top corner, no margin. I am having trouble doing that in PHP, and I am not quite sure if this is a PHP problem, or a CSS problem. Here's what I have so far:
It just gives me some stupid header errors, and I know that you can't do it from CSS when you're creating an image with PHP, which leaves me in quite a problem here. Basically, I NEED this to be aligned right to the corner, else it will look off centered and will have a white background.
Does anybody have a work around for this? Or is there a way to set the margin before creating the image with PHP?
Thank you for your help.
http://clan-ik.frih.net/bserver/test.html
It's right in the top corner, no margin. I am having trouble doing that in PHP, and I am not quite sure if this is a PHP problem, or a CSS problem. Here's what I have so far:
| Code: |
| <style>
body { margin: 0; } </style> <body> <?php $my_img = imagecreate( 199, 50 ); $background = imagecolorallocate( $my_img, 0, 0, 255 ); $text_colour = imagecolorallocate( $my_img, 255, 255, 0 ); $line_colour = imagecolorallocate( $my_img, 128, 255, 0 ); imagestring( $my_img, 4, 30, 25, "TEXT", $text_colour ); imagesetthickness ( $my_img, 5 ); imageline( $my_img, 30, 45, 165, 45, $line_colour ); header( "Content-type: image/png" ); imagepng( $my_img ); imagecolordeallocate( $line_color ); imagecolordeallocate( $text_color ); imagecolordeallocate( $background ); imagedestroy( $my_img ); ?> </body> |
It just gives me some stupid header errors, and I know that you can't do it from CSS when you're creating an image with PHP, which leaves me in quite a problem here. Basically, I NEED this to be aligned right to the corner, else it will look off centered and will have a white background.
Does anybody have a work around for this? Or is there a way to set the margin before creating the image with PHP?
Thank you for your help.
