Skip to content

Commit d980902

Browse files
committed
set value bug fix
1 parent b2ade7a commit d980902

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Demo-CustomQRCore/ViewController.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ - (UIImage*)imageBlackToTransparent:(UIImage*)image withRed:(CGFloat)red andGree
8888
uint32_t* pCurPtr = rgbImageBuf;
8989
for (int i = 0; i < pixelNum; i++, pCurPtr++){
9090
if ((*pCurPtr & 0xFFFFFF00) < 0x99999900){
91-
// 改成下面的代码,会将图片转成想要的颜色
91+
// change color
9292
uint8_t* ptr = (uint8_t*)pCurPtr;
93-
ptr[3] = 60; //0~255
94-
ptr[2] = 74;
95-
ptr[1] = 89;
93+
ptr[3] = red; //0~255
94+
ptr[2] = green;
95+
ptr[1] = blue;
9696
}else{
9797
uint8_t* ptr = (uint8_t*)pCurPtr;
9898
ptr[0] = 0;

0 commit comments

Comments
 (0)