随笔分类 - C/C++
摘要:lv_obj_t *imgBtn=lv_imgbtn_create(lv_scr_act(), NULL); lv_obj_set_style_local_transform_zoom(imgBtn, LV_BTN_PART_MAIN,LV_STATE_DEFAULT,2);
阅读全文
摘要:static lv_style_t style_scr_act; if (style_scr_act.prop_cnt == 0) { lv_style_init(&style_scr_act); lv_style_set_bg_opa(&style_scr_act, LV_OPA_COVER);
阅读全文
摘要:// 从文件加载证书 X509* load_certificate_from_file(const char* filename) { BIO* bio = BIO_new_file(filename, "r"); if (!bio) { fprintf(stderr, "Error opening
阅读全文
摘要:int save_public_key_from_file(const char* filename,RSA *key) { BIO* bio = BIO_new_file(filename, "w"); if (!bio) return NULL; int ret = PEM_write_bio_
阅读全文
摘要:测试代码: #include <openssl/rsa.h> #include <openssl/pem.h> #include <openssl/err.h> #include <string.h> void handle_openssl_errors() { ERR_print_errors_f
阅读全文
摘要:好的,这是一个非常经典且高效的位操作技巧,用于实现内存对齐(Memory Alignment)。我们来一步步拆解这行代码: uint32_t aligned = (n + 7u) & ~7u; 它的目的: 计算大于等于 n 的最小的、8字节对齐的数。 换句话说,它会把 n “向上取整”到最接近的 8
阅读全文
摘要:效果: 源码: // guitool_demo.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include <stdio.h> #include <windows.h> #define PIXELS_PER_BYTE 8
阅读全文
摘要:lv_label_set_text_fmt(amountObj, "$%d.%02d", atoi(amount) / 100, atoi(amount) % 100); 该接口默认不支持浮点型,源码编译的时候需要手动开启
阅读全文
摘要:char str[] = "apple,banana,cherry,date,我不是萧海哇"; // 必须是可修改的字符数组 const char delimiters[] = ","; // 分隔符 char** output=NULL; int cnt = 0; printf("Original
阅读全文

浙公网安备 33010602011771号