[system] / trunk / pg / macros / PGbasicmacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGbasicmacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2442 Revision 2443
1861 1861
1862=head2 Macros for displaying static images 1862=head2 Macros for displaying static images
1863 1863
1864 Usage: 1864 Usage:
1865 $string = image($image, width => 100, height => 100, tex_size => 800) 1865 $string = image($image, width => 100, height => 100, tex_size => 800)
1866 $string = image($image, width => 100, height => 100, extra_html_tags => 'align="middle"', tex_size => 800)
1866 $string = image([$image1, $image2], width => 100, height => 100, tex_size => 800) 1867 $string = image([$image1, $image2], width => 100, height => 100, tex_size => 800)
1867 $string = caption($string); 1868 $string = caption($string);
1868 $string = imageRow([$image1, $image2 ], [$caption1, $caption2]); 1869 $string = imageRow([$image1, $image2 ], [$caption1, $caption2]);
1869 # produces a complete table with rows of pictures. 1870 # produces a complete table with rows of pictures.
1870 1871
1881 my %in_options = @opt; 1882 my %in_options = @opt;
1882 my %known_options = ( 1883 my %known_options = (
1883 width => 100, 1884 width => 100,
1884 height => 100, 1885 height => 100,
1885 tex_size => 800, 1886 tex_size => 800,
1887 extra_html_tags => '',
1886 ); 1888 );
1887 # handle options 1889 # handle options
1888 my %out_options = %known_options; 1890 my %out_options = %known_options;
1889 foreach my $opt_name (keys %in_options) { 1891 foreach my $opt_name (keys %in_options) {
1890 if ( exists( $known_options{$opt_name} ) ) { 1892 if ( exists( $known_options{$opt_name} ) ) {
1936 my $wid = ($envir->{onTheFlyImageSize} || 0)+ 30; 1938 my $wid = ($envir->{onTheFlyImageSize} || 0)+ 30;
1937 $out = qq!\\begin{rawhtml}\n<A HREF= "$imageURL" TARGET="_blank" onclick="window.open(this.href,this.target, 'width=$wid,height=$wid,scrollbars=yes,resizable=on'); return false;"><IMG SRC="$imageURL" WIDTH="$width" HEIGHT="$height"></A>\n 1939 $out = qq!\\begin{rawhtml}\n<A HREF= "$imageURL" TARGET="_blank" onclick="window.open(this.href,this.target, 'width=$wid,height=$wid,scrollbars=yes,resizable=on'); return false;"><IMG SRC="$imageURL" WIDTH="$width" HEIGHT="$height"></A>\n
1938 \\end{rawhtml}\n ! 1940 \\end{rawhtml}\n !
1939 } elsif ($displayMode eq 'HTML' || $displayMode eq 'HTML_tth' || $displayMode eq 'HTML_dpng' || $displayMode eq 'HTML_img' || $displayMode eq 'HTML_jsMath' || $displayMode eq 'HTML_asciimath') { 1941 } elsif ($displayMode eq 'HTML' || $displayMode eq 'HTML_tth' || $displayMode eq 'HTML_dpng' || $displayMode eq 'HTML_img' || $displayMode eq 'HTML_jsMath' || $displayMode eq 'HTML_asciimath') {
1940 my $wid = ($envir->{onTheFlyImageSize} || 0) +30; 1942 my $wid = ($envir->{onTheFlyImageSize} || 0) +30;
1941 $out = qq!<A HREF= "$imageURL" TARGET="_blank" onclick="window.open(this.href,this.target, 'width=$wid,height=$wid,scrollbars=yes,resizable=on'); return false;"><IMG SRC="$imageURL" WIDTH="$width" HEIGHT="$height"></A> 1943 $out = qq!<A HREF= "$imageURL" TARGET="_blank" onclick="window.open(this.href,this.target, 'width=$wid,height=$wid,scrollbars=yes,resizable=on'); return false;"><IMG SRC="$imageURL" WIDTH="$width" HEIGHT="$height" $out_options{extra_html_tags} ></A>
1942 ! 1944 !
1943 } else { 1945 } else {
1944 $out = "Error: PGbasicmacros: image: Unknown displayMode: $displayMode.\n"; 1946 $out = "Error: PGbasicmacros: image: Unknown displayMode: $displayMode.\n";
1945 } 1947 }
1946 push(@output_list, $out); 1948 push(@output_list, $out);

Legend:
Removed from v.2442  
changed lines
  Added in v.2443

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9