#!usr/bin/perl use strict; our $internet=0; require "draw.pl"; my ($width,$height)=(1024,768); #IMAGE RESOLUTION # Width Height Zoom Function Bounds[L] [U] Step? my $Graph=&bmp($width,$height, shift||1, shift || "z^2", -10, 10, shift || 1); #Output my $file = "output.bmp"; my $winBMPFileHeader = pack ("a2LS2L", "BM", 0, 0, 0, 14+40); my $BMPheader= pack("L3S2L6", 40, $width, $height, 1, 24, 0, 0, 0, 0, 6, 0); open FILE, ">$file" or die "The file is in use. Please wait ~1min and try again.
Dump : $!"; print FILE $winBMPFileHeader.$BMPheader; for (my $y=0; $y<$height; $y++) { #Img stored down->up. Pixel value goes up->down. We want lower pixels #To be higher on the y axis so the double inversion cancels out. for (my $x=0; $x<$width; $x++) { $Graph->[$y]->[$x]->[0]=0 unless $Graph->[$y]->[$x]; print FILE ($Graph->[$y]->[$x]->[0]) ? &disp(@{$Graph->[$y]->[$x]}) : pack("c3",0,0,0); } } close FILE;