当前位置:网站首页>Use of ue5 QRcode plug-in
Use of ue5 QRcode plug-in
2022-07-03 08:15:00 【The east wind blows the Willows】
This plug-in is repackaged with the source code , Do not rely on static libraries , Pure source code , Apply to more than one UE edition , There is no problem with the editor and packaging release . I am UE5EA Upper test passed .
1. Source access address
2. Plug-in address
UE4UE5QRCode Source version - Internet document resources -CSDN download
3. Major changes
For use after packaging , Revised UQRCodeComponent Class GenerateQrCode Method :
UTexture2D* UQRCodeComponent::GenerateQrCode(UObject* parent, FString string)
{
qrcodegen::QrCode qr = qrcodegen::QrCode::encodeText(TCHAR_TO_UTF8(*string), qrcodegen::QrCode::Ecc::LOW);
uint8 size = qr.getSize();
TArray<FColor> pixels;
pixels.SetNumZeroed(size * size);
FColor black = FColor::Black;
FColor white = FColor::White;
for (uint8 x = 0; x < size; x++)
{
for (uint8 y = 0; y < size; y++)
{
FColor color = qr.getModule(x, y) ? white : black;
pixels[x + y * size] = color;
}
}
UTexture2D* texture = UTexture2D::CreateTransient(size, size, EPixelFormat::PF_B8G8R8A8, "QRCode");
void* data = texture->PlatformData->Mips[0].BulkData.Lock(1);
FMemory::Memcpy(data, pixels.GetData(), size * size * 4);
texture->PlatformData->Mips[0].BulkData.Unlock();
texture->UpdateResource();
texture->Filter = TextureFilter::TF_Nearest;
return texture;
}
4. Usage method
1) Create a actor Blueprint class , To add QRCode Components
2) Create a for displaying QR code UI
3) Write blueprint code in the level blueprint
4) Running effect
边栏推荐
- LinkList
- Getting started with minicom
- Editor Extensions
- An intern's journey to cnosdb
- P2704 [noi2001] artillery position (shape pressure DP)
- Docker installs MySQL and successfully uses Navicat connection
- Oracle insert single quotation mark
- regular expression
- Viz artist advanced script video tutorial -- stringmap use and vertex operation
- Haproxy+kept build 01
猜你喜欢
随机推荐
Install cross compiler arm none liunx gnueabihf
Transfinite hacker cognition
Dotween plug-in
animation
Golang 时间格式整理
How to establish rectangular coordinate system in space
C language - Introduction - essence Edition - take you into programming (I)
Mall management system of database application technology course design
JS common basic case sorting (continuous update)
[usaco12mar]cows in a skyscraper g (state compression DP)
數據庫應用技術課程設計之商城管理系統
go 解析身份证
Retail philosophy retail psychological warfare after reading -- 7-11 is a good product!
jupyter远程服务器配置以及服务器开机自启
A tunnel to all ports of the server
[cocos creator] Click the button to switch the interface
unity2019_ Input management
[set theory] order relation (the relation between elements of partial order set | comparable | strictly less than | covering | Haas diagram)
Get to know unity2 for the first time
Viz artist advanced script video tutorial -- stringmap use and vertex operation