Quick Sign In:  

Forum: VirtualDJ Skins

Topic: Converter Size Skin Virtual DJ - Page: 1

This part of topic is old and might contain outdated or incorrect information

Hello
To easily convert the your size of your skin veiled a script.

It converted for you size of all beacons of your file XML.

Note you must make the conversion of your file BMP manually.

size supported :
640x480
800x600
1024x768
1280x960
1600x1200

http://atomixfr.atomixmp3.com/converter/multi/

Converter by DJ-Maboul (ATOMIX-FR)
 

Posted Sat 05 Jul 03 @ 8:09 pm
djzeroPRO InfinityMember since 2003
the above link is no longer valid, this was a very useful utility & could have easily been altered to adjust for widescreen skins aswell.

can someone from the team please contact dj-maboul & make these utilities avaliable on the vdj site... it would greatly help us skin developers to port the skins to different skin sizes

DjZero
 

Posted Mon 30 May 05 @ 1:05 pm
frd1963PRO InfinityMember since 2004
I have a perl script that I made that does just that. I didn't waste too much time making it user friendly though because I figured I would be the only one using it.
I will post its contents into a spearate reply so that it can be copied & pasted.
It only resizes the xml, but does provide percentages for use in the 'stretch' function of MS Paint.
 

Posted Tue 31 May 05 @ 8:50 pm
frd1963PRO InfinityMember since 2004
#!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";
}
 

Posted Tue 31 May 05 @ 8:53 pm
frd1963PRO InfinityMember since 2004
skinResize.pl syntax:

perl skinResize.pl SKIN.xml [WIDTH [HEIGHT]]

SKIN is the name of the XML file for the skin
WIDTH is the desired width
HEIGHT is the desired height

A new file named SKIN.WIDTHxHEIGHT.xml will be created.
You will be reminded to 'stretch' your .bmp file to match the new xml file and will be given the stretch percentages to use.

There are no restrictions on the WIDTH and HEIGHT, so have fun!

Let me know if this is useful and/or if you experience any bugs. I am not going to devote alot of time to maintaining this script, but I will be willing to make some changes if necessary.
 

Posted Tue 31 May 05 @ 9:07 pm
frd1963PRO InfinityMember since 2004
I just realized that the forum strips out some characters and so copying and pasting the previously posted perl script will not work. I will repost with the missing characters.
 

Posted Tue 31 May 05 @ 9:10 pm
frd1963PRO InfinityMember since 2004
#!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";
}
 

Posted Tue 31 May 05 @ 9:23 pm
erxonPRO InfinityMember since 2003
frd1963:

Why don't you put these things in your blog, and than just link people to it, so they can view it ;)
 

Posted Wed 01 Jun 05 @ 5:46 pm
frd1963PRO InfinityMember since 2004
Erxon,

Good idea... done.
 

Posted Wed 01 Jun 05 @ 10:55 pm
frd1963PRO InfinityMember since 2004
Use the one from my blog. html doesn't show all necessary characters so I think I got it correct in the blog.
 

Posted Wed 01 Jun 05 @ 11:03 pm
vespaHome userMember since 2004
any "*.exe" aviable ??
or how many difficult for an ignorant like me try to compile "perl" language?
 

Posted Wed 03 Aug 05 @ 5:25 pm
frd1963PRO InfinityMember since 2004
 

Posted Thu 04 Aug 05 @ 5:49 pm
djcelPRO InfinityModeratorMember since 2004
Yes an .exe should be better ;-)
 

Posted Thu 04 Aug 05 @ 8:19 pm
djzeroPRO InfinityMember since 2003
i couldn't get it to work when i tried, an exe would be excellent if it is possible doesnt need a graphical front end just cmd is fine
 

Posted Fri 05 Aug 05 @ 7:07 am
frd1963PRO InfinityMember since 2004
I will create an .exe, but where can I post it once it is created? Is there a way for others to be able to download it through my blog? I don't have any external webserver space that I could store it on.
 

Posted Fri 05 Aug 05 @ 5:49 pm
JeremKPRO InfinityStaffMember since 2004
you can either upload it in the plugins sections of this site. But the team has to accept it.

If they don't then upload it to www.yousendit.com and share the link to download the exe with us.
 

Posted Fri 05 Aug 05 @ 5:56 pm
djcelPRO InfinityModeratorMember since 2004
I advise you to upload it on the plugins space. It will be easier for everybody
 

Posted Sat 06 Aug 05 @ 11:20 am
PANOSVPRO InfinityMember since 2007
this script does not work as is since most probably there are parts of code missing. Nevertheless I together with a friend of mine completed the script and as looks (unfortunately there wasn't much time for long beta testing :)) works great. Another problem is that cannot be made as an *.exe(since the compilation is in an experimental stage, an as an *.exe don't work properly) so if any of you want it should have also the active perl in order to run .If any of you want it just ask
 

Posted Fri 02 Sep 05 @ 2:05 am
frd1963PRO InfinityMember since 2004
Yeah, copying and pasting from the message board is flaky because some characters get left out (such as backslashes '\\') unless entered a certain way. I had tried to go over it with a fine-tooth comb to correct all of these, but it just wasn't worth the trouble.
Also, I have been using the script myself lately and have made some improvements as well as fixing some bugs.

I have posted my latest version of the script here for download:

http://s49.yousendit.com/d.aspx?id=0CAZ1K3NERLB60E0SKCVINP5IB

Let me know if you have problems with it.
Also, I have found that PhotoShop does a MUCH better job at resizing the .bmp file than MS Paint. I highly recommend using PhotoShop to do the resize especially if you are changing the aspect ratio (normal to widescreen, or vice versa.)
 

Posted Tue 06 Sep 05 @ 8:04 pm
PANOSVPRO InfinityMember since 2007
yeah you 're right for the forum, but would you like to give me your mail to send it to you just to check it? I've done some improvements too;). photoshop is a lot better in resizing the bmp since it uses also the percentages of the script :)
 

Posted Tue 06 Sep 05 @ 11:41 pm
71%