public function Output2Base64($AvatarSize = 0)
    {
        if (!$AvatarSize) {
            $AvatarSize = $this->AvatarSize;
        }

        ob_start();
        imagepng($this->Resize($AvatarSize));
        $content = ob_get_contents();
        ob_end_clean();

        return 'data:image/png;base64,' . base64_encode($content);
    }