
BOOL TransparentBlt(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int hHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, UINT crTransparent)
crTransparent:源位图中的RGB值当作透明颜色。
比如:人物图片底色是黑色,用TransparentBlt函数blt图片,参数crTransparent设为黑色RGB(0,0,0),就能完成透明拷贝。
1、比如定义一个数
int a=0x1111
(unsigned int male=0x4)那么 a|male 的值就是0001 0001 00010101 只有第三位影响了
unsigned int male=0xFF 那么 a|male 的值就是111111111 0001 0001 后8位值不变
2、例程:
#include <stdio.h>#include <conio.h>
#include <ctype.h>
#define MAX_PASSWD_LEN 20
char *GetPasswd(char pasw[]) {
unsigned char ch
int i = 0
while((ch = _getch()) != '\r') {
if(i > 0 && ch == '\b') {
--i
putchar('\b')
putchar(' ')
putchar('\b')
}
else if(i < MAX_PASSWD_LEN && isprint(ch)) {
pasw[i++] = ch
putchar('*')
}
}
putchar('\n')
pasw[i] = '\0'
return pasw
}
int main() {
char psw[MAX_PASSWD_LEN] = {0}
printf("%s\n",GetPasswd(psw))
return 0
}
#include <stdio.h>#include <conio.h>
#include <ctype.h>
#define MAX_PASSWD_LEN 20
char *GetPasswd(char pasw[]) {
unsigned char ch
int i = 0
while((ch = _getch()) != '\r') {
if(i > 0 && ch == '\b') {
--i
putchar('\b')
putchar(' ')
putchar('\b')
}
else if(i < MAX_PASSWD_LEN && isprint(ch)) {
pasw[i++] = ch
putchar('*')
}
}
putchar('\n')
pasw[i] = '\0'
return pasw
}
int main() {
char psw[MAX_PASSWD_LEN] = {0}
printf("%s\n",GetPasswd(psw))
return 0
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)