What's on your Ctrl+V?

571487306.gif
 
Code:
TempData[AdminTempDataKeys.InlineAlert] = new InlineAlert("Permission denied", "warning", new List<string>() { "You do not currently have access rights to that section of this website.", "This issue may have been caused by a session time-out.", "Please enter your login details below to gain access." });
Yay for having to work at the weekend.

/sarcasm.
 
RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE
 
list($base_width, $base_height) = getimagesize($filename);

$ratioh = $req_height/$base_height;
$ratiow = $req_width/$base_width;
$ratio = max($ratioh, $ratiow);

// New dimensions
$new_width = intval($ratio*$base_width);
$new_height = intval($ratio*$base_height);

//Offset required
$offset_width = ($new_width - $req_width) / 2;
$offset_height = ($new_height - $req_height) / 2;


$canvas = imagecreatetruecolor($req_width, $req_height);
imagecopyresampled($canvas, $img, 0, 0, $offset_width, $offset_height, $new_width, $new_height, $base_width, $base_height);

return $canvas;

Some code i was just working on :)
 
so I get the perfect level of fizz, and ensure I don't create a bloody great mess when they explode due to being slightly overzealous in my early days


It's really not as dirty as it sounds...
 
Back
Top Bottom