Browse Source

Ajout Elisabeth 2

master
MEUNIER Thibaud 3 years ago
parent
commit
61453396d6
4 changed files with 19 additions and 8 deletions
  1. +16
    -5
      blockchain/inc/block.php
  2. BIN
      methode2.tgz
  3. +1
    -1
      methode2/circle/draw.php
  4. +2
    -2
      methode2/mondrian/draw.php

+ 16
- 5
blockchain/inc/block.php View File

@ -78,6 +78,12 @@ class blockchain
{
self::$special_blocks = array ();
self::$special_blocks[] = new block(
'00000000000000000001f5beb60d9ca47adf18db5136b558379ed533fc9f6c85',
753335,
'ELISABETH_2_HAS_DIED'
);
self::$special_blocks[] = new block(
'000000000000000000065676a19a2dfba0171b592d52f5ea7db54d45bb386400',
724697,
@ -549,7 +555,7 @@ class blockchain
// pour splinelineblack
[
[17,61,86],
[254,254,254]
[255,255,255]
],
[
[17,61,86],
@ -590,16 +596,18 @@ class blockchain
// Rajout des HASHES
$white = imagecolorallocate($vImage, 254, 254, 254);
$black = imagecolorallocate($vImage, $color_tab[$color][1][0], $color_tab[$color][1][1], $color_tab[$color][1][2]);
$fond = imagecolorallocate($vImage, $color_tab[$color][0][0], $color_tab[$color][0][1], $color_tab[$color][0][2]);
$fond = imagecolorallocate($vImage, 255, 255, 255);
$black = imagecolorallocate($vImage, 0, 0, 0);
$w = imagesx($vImage);
$h = imagesy($vImage);
// On rend le blanc transparent
imagecolortransparent($vImage, $white);
// On place un fond transparent
// On place un fond transparent sur toute l'image
imagefilledrectangle($vImage, 0, 0, $w, $h, $white);
// Puis un fond sur la zone de dessin...
imagefilledrectangle($vImage, 0, $hauteur, $w, $h-$hauteur, $fond);
$len = strlen($the_block->hash);
$ratio_w = ($w - 10) / $len;
@ -704,7 +712,10 @@ class blockchain
$bbox = imagettfbbox(14, 0, $font, $the_name);
imagettftext($vImage, 14, 0, ($w-3)-($bbox[2]-$bbox[0]), ($hauteur-5), $black, $font, $the_name);
return [$white, $fond, $black, $font, $color_tab[$color][1], $color_tab[$color][0]];
$draw = imagecolorallocate($vImage, $color_tab[$color][1][0], $color_tab[$color][1][1], $color_tab[$color][1][2]);
$fond = imagecolorallocate($vImage, $color_tab[$color][0][0], $color_tab[$color][0][1], $color_tab[$color][0][2]);
return [$white, $fond, $draw, $font, $color_tab[$color][1], $color_tab[$color][0]];
}
public static function getTransactionData($the_block, $type=1)

BIN
methode2.tgz View File


+ 1
- 1
methode2/circle/draw.php View File

@ -44,7 +44,7 @@ function DrawBlock($the_block, $vImage, $parametres)
foreach($data as $transaction)
{
for($i=0;$i<$nbColor;$i++)
for($i=0;$i < $nbColor;$i++)
{
$valeur = hexdec($transaction['hash'][$i%TX_HASH_LEN]);
if ($valeur != 0) $valeur += $valeur - 8;

+ 2
- 2
methode2/mondrian/draw.php View File

@ -53,8 +53,8 @@ function DrawBlock($the_block, $vImage, $parametres)
//if (($x2 - $x1) < ($width*0.015)) break;
//if (($y2 - $y1) < ($height*0.015)) break;
$factor=$the_block->nonce % 100;
// Je triche: les petits rectangle sont blancs
$factor=($x1*$x2*$y1*$y2) % 100;
// Je triche: les petits rectangles sont blancs
if (($x2 - $x1) < 6) $factor=90;
if (($y2 - $y1) < 6) $factor=90;

Loading…
Cancel
Save