PoSH Challenge part 6
Level 7 is the first level in the the python challenge that involves working with bitmaps,
before I give my answer to this level of the Python challenge
I made a small PoSH version ,
* Reader Challenge * what text is hidden in the following picture ?
to get you going you can take a look at my solution for level 7 of the Python challenge :
<?xml version="1.0"?>
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$bm = [System.Drawing.Bitmap]::FromFile( 'C:\_spons\oxygen.png' )
$a = 0..607 |% {$bm.GetPixel($_,50)} |% {$_.r}
$line = ""
for ($i=0;$i -lt 607;$i+=7) {$line += [char]$a[$i]}
$line
$ofs = ''
"$([regex]::Match($line,'\[(.*)\]').groups[1].value.split(',') |% {[char][int]$_.trim()})"
and as my PowerShell example is a bit simpler as the Python one, 3 lines should do for it (including loading of system.drawing namespace and opening the piano.png picture ;-)
More PowerShell bitmap fun later in this series.
Enjoy,
Greetings /\/\o\/\/
PS. anonymous comments are disabled as I got to much spam, to be able to post your answer to the comments, you need to register. You can find a link to the registration page on the top right corner of the blog, this is an easy process, without a need to provide personal data