Usuario :       Contraseña :       Recordarme

frd1963

Este usuario no se ha introducido su descripción todavia.



Perl script for resizing VDJ skins v1.0

Wed 01 Jun 05 @ 10:55 pm


#!perl
#
#Script for resizing skin defining XML files for VirtualDJ
# by frd1963

$V = 0;
$XML = $ARGV[0];
$WIDTH = $ARGV[1];
$HEIGHT = $ARGV[2];

die "Must specify a valid xml file!" unless (-e "$XML");
open(INFILE,"$XML") || die "Can't open '$XML' : $!";
my @in = ;
close(INFILE);

# Get original height and width
$height = $in[0];
$width = $in[0];
chomp($width);
chomp($height);
print("Using header line '$width'\n") if $V;
$height =~ s/^.*\sheight=\"(\d+)\".*/\1/i;
$width =~ s/^.*\swidth=\"(\d+)\".*/\1/i;

#prompt for new dimensions if not defined or invalid
while ($HEIGHT !~ /^\d+$/ || $WIDTH !~ /^\d+$/) {
     print("Old width = $width     Enter new width : ");
     $WIDTH = ;
     chomp($WIDTH);
     print("Old height = $height     Enter new height: ");
     $HEIGHT = ;
     chomp($HEIGHT);
}

#calculate conversion ratios
my $ratioX = ($WIDTH / $width);
my $ratioY = ($HEIGHT / $height);
print("Width ratio =     $ratioX\nHeight ratio =     $ratioY\n") if $V;

# Convert the sizes, positions and widths
# iterating through each line
$size = @in;
for(my $i = 0; $i $newName") || die "Can't open '$newName' : $!";
foreach $line (@in) {
     print OUTFILE ("$line\n");
}
close(OUTFILE);

$ratioX *= 100;
$ratioY *= 100;
$bmp = $XML;
$bmp =~ s/.xml$/.bmp/i;
$newBmp = "$bmp" . "${HEIGHT}x${WIDTH}" . "bmp";
$bmp = "$bmp" . ".bmp";
print("Now don't forget to make '$newBMP' by stretching '$bmp':\n\tstretch width by '$ratioX%'\n\tstretch height by '$ratioY%'\n");

exit;

sub Convert {
     my $string = shift(@_);
     my $r = shift(@_);
     my @list = @_;

     my $newString = $string;

     foreach my $tag (@list) {
          my $value = $newString;
          $value =~ s/^.*$tag=\"(\d+)\".*/\1/i;
          next if ($value eq "" || $value eq $newString);
          print("Scaling for tag '$tag': '$value' becomes ");
          $value *= $r;
          $value = int($value + .5);
          print("'$value'\n");
          $newString =~ s/^(.*$tag=\")\d+(\".*)/\1$value\2/i;
     }
     return "$newString";
}


Site map
(C)opyright Atomix Productions 2012

Programas
Hardware
Membresía
Artículos Promocionales
VirtualDJ Pro Full
VirtualDJ Basic
VirtualDJ Broadcaster
VirtualDJ Home GRATIS
VirtualDJ LE
Comparitivo
Numark CUE
VirtualVinyl
VirtualDJ iRemote
AtomixMP3
eJay DJMixStation
DJ-Box
Why VirtualDJ?
Vdj for Video
Vdj for Turntablism
Vdj for Club DJ
Vdj for Mobile DJ
What's new
Características
Pantallas
VirtualDJ Home GRATIS
Manuales de Usuario
Plugins
Actualizaciones de Software
Material para la prensa
SDK para Desarrolladores
CD de Código de Tiempo
Skins (Pieles)
Efectos
Controladores
Idiomas
Samples
Grafx
Herramientas y Controladores
Foros
Usuarios en red
Grupos de Música
Manuales y Wiki
Radio
Revista
Web Social
Crear un usuario
Atomix Productions
Política de Privacidad
DJs VIP
Haga una Pregunta
Vea sus tickets de soporte
Manuales y Wiki