-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logo to the middle of qr code? #25
Comments
hi BR9, have you resolve it? I need it too |
same, i need it |
i have solved it... perhaps i will tell tomorrow, need to sleep today :D |
thanks before. |
how you make it?can you share it? i really need to know |
here is my code for adding the logo... sory taking so long, I am on a full busy day..
There it is, thank you all |
where to put this code sir? i found this kind of code but still confusing
to use it and where to put it..
if you can assist me sir..
…On Sun, Jul 14, 2019 at 7:48 PM IniAku ***@***.***> wrote:
here is my code for adding the logo... sory taking so long, I am on a full
busy day..
`$this->config->load('logoqrcode',TRUE);
$logolocation = $this->config->item('qrcodelogo', 'logoqrcode');
$qrlocation = "$codepath.png";
$QR = imagecreatefrompng("$codepath.png");
$logo = imagecreatefrompng($logolocation);
imagecolortransparent($logo , imagecolorallocatealpha($logo , 0, 0, 0,
127));
imagealphablending($logo , false);
imagesavealpha($logo , true);
$QR_width = imagesx($QR);
$QR_height = imagesy($QR);
$logo_width = imagesx($logo);
$logo_height = imagesy($logo);
// Scale logo to fit in the QR Code
$logo_qr_width = $QR_width/3;
$scale = $logo_width/$logo_qr_width;
$logo_qr_height = $logo_height/$scale;
imagecopyresampled($QR, $logo, $QR_width/3, $QR_height/3, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
/*}*/
imagepng($QR, $qrlocation);
imagedestroy($QR);`
There it is, thank you all
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AHXDQ7AUQ4NC6C26QQY3MOTP7MG7LA5CNFSM4FZIIRWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4DXEI#issuecomment-511196049>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXDQ7HRB5C6EJVIX27EEVDP7MG7LANCNFSM4FZIIRWA>
.
|
@rusyaidisupian
|
hello, how are you?
Why do you send me this rubbish code ?
Who do you think I am ?
…On Thu, Jan 30, 2020 at 9:13 PM Juliar Nasution ***@***.***> wrote:
@rusyaidisupian <https://github.com/rusyaidisupian>
this is my code, you can try it
`public function generate_qr_code($value)
{
$filename = $value.'.png';
$fullpath = APPPATH.'../public/files/'.$filename;
$logopath = APPPATH.'../assets/img/logo/kemdikbud.png';
unlink($fullpath);
if (!file_exists($fullpath)) {
$this->load->library('ciqrcode');
$params['data'] = $value;
$params['level'] = 'H';
$params['size'] = 10;
$params['savename'] = $fullpath;
$this->ciqrcode->generate($params);
$QR = imagecreatefrompng($fullpath);
// memulai menggambar logo dalam file qrcode
$logo = imagecreatefromstring(file_get_contents($logopath));
imagecolortransparent($logo , imagecolorallocatealpha($logo , 0, 0, 0,
127));
imagealphablending($logo , false);
imagesavealpha($logo , true);
$QR_width = imagesx($QR);//get logo width
$QR_height = imagesy($QR);//get logo width
$logo_width = imagesx($logo);
$logo_height = imagesy($logo);
// Scale logo to fit in the QR Code
$logo_qr_width = $QR_width/2;
$scale = $logo_width/$logo_qr_width;
$logo_qr_height = $logo_height/$scale;
imagecopyresampled($QR, $logo, $QR_width/4, $QR_height/3.5, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
// Simpan kode QR lagi, dengan logo di atasnya
imagepng($QR,$fullpath);
}
return $filename;
}`
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AMYJ22F6DZB5RVNY6P5XFDDRALHADA5CNFSM4FZIIRWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKK5WRY#issuecomment-580246343>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMYJ22FIPSIYSKQG4ZEWFELRALHADANCNFSM4FZIIRWA>
.
|
It's easy. |
Hello,
How can we do that?
QR I want to add logo to the middle of code?
The text was updated successfully, but these errors were encountered: