GetQRCodeImage 메서드 |
Google OTP에 등록할 수 있는 QR 코드 이미지를 생성합니다.
imageData = objOtp.GetQRCodeImage(authURI, prescaler, pixelColor, bgColor)
objOtp
Required. GoogleOTP 오브젝트
imageData
Blob. PNG 포맷으로 생성된 QR 코드 이미지 데이터(바이너리 형식)를 반환합니다.
authURI
String. QR 코드에 기록될 URI 문자열을 지정합니다.
prescaler
Long. QR 코드 이미지의 한 픽셀 크기를 지정합니다.
pixelColor
String. QR 코드 이미지의 픽셀 색상을 지정합니다.
bgColor
String. QR 코드 이미지의 배경 색상을 지정합니다.
authURI를 기반으로 QR 코드 이미지를 생성합니다. 생성된 이미지는 Google OTP 앱의 바코드 스캔 기능을 사용해 OTP 계정의 입력할 수 있습니다. authURI는 GetTOTPAuthURI를 호출해 생성할 수 있습니다.
QR 코드 이미지는 PNG 포맷으로 생성되며 Blob 형식으로 반환되므로 ASP의 Response.BinaryWrite 메서드를 사용해 웹 브라우저로 전송할 수 있습니다.
<% Dim otp, imageData Set otp = Server.CreateObject("TABS.GoogleOTP") imageData = otp.GetQRCodeImage(Session("AUTHURI"), 4, "#000000", "#ffffff") Response.ContentType = "image/png" Response.BinaryWrite imageData %>