version 1.29, 2007/09/25 22:56:48
|
version 1.31, 2008/12/19 14:28:14
|
Line 213 sub get_image {
|
Line 213 sub get_image {
|
my ($imgsrc,$set_trans)=@_; |
my ($imgsrc,$set_trans)=@_; |
my $image; |
my $image; |
if ($imgsrc !~ m|^(/home/)|) { |
if ($imgsrc !~ m|^(/home/)|) { |
if ($imgsrc !~ /^http:/) { |
if ($imgsrc !~ /^https?\:/) { |
$imgsrc="http://".$ENV{'HTTP_HOST'}.$imgsrc; |
$imgsrc=&Apache::lonnet::absolute_url($ENV{'HTTP_HOST'}).$imgsrc; |
} |
} |
my $ua=new LWP::UserAgent; |
my $ua=new LWP::UserAgent; |
my $request=new HTTP::Request('GET',"$imgsrc"); |
my $request=new HTTP::Request('GET',"$imgsrc"); |
Line 267 sub get_color_from_hexstring {
|
Line 267 sub get_color_from_hexstring {
|
return $imcolor; |
return $imcolor; |
} |
} |
|
|
|
sub add_click { |
|
my ($image) = @_; |
|
|
|
my $length=6; |
|
my $bgcolor=&get_color_from_hexstring($image,'FFFFFF'); |
|
my $fgcolor=&get_color_from_hexstring($image,'009999'); |
|
|
|
my ($x,$y) = split(':',$env{'form.clickdata'}); |
|
|
|
$image->setThickness(3); |
|
$image->line($x-$length,$y, $x+$length,$y, $bgcolor); |
|
$image->line($x, $y-$length,$x, $y+$length,$bgcolor); |
|
$image->setThickness(1); |
|
$image->line($x-$length,$y, $x+$length,$y, $fgcolor); |
|
$image->line($x, $y-$length,$x, $y+$length,$fgcolor); |
|
} |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
$r->content_type('image/png'); |
$r->content_type('image/png'); |
Line 429 sub handler {
|
Line 446 sub handler {
|
&Apache::lonnet::logthis("randomlylabel unable to handle object of type $type"); |
&Apache::lonnet::logthis("randomlylabel unable to handle object of type $type"); |
} |
} |
} |
} |
|
if (exists($env{'form.clickdata'})) { &add_click($image); } |
$image->setThickness(1); |
$image->setThickness(1); |
$r->print($image->png); |
$r->print($image->png); |
return OK; |
return OK; |