I am not sure where you are trying to do this but give something like this a try.
<?php
$category_id = 45;
query_posts('showposts=1&cat=".$category_id);
if (have_posts()) : while (have_posts()) : the_post();
$backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), "full' );
endwhile; endif;
wp_reset_query();
?>