Jump to content

Vikash

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Vikash

    Draw QR Code

    Hi @Joel Bodenmann Thanks for your reply. As of now I am generating png file with QR Data. I am using below logic to create a png file. Here, size = qr->width; const int red = 255; const int green = 255; const int blue = 255; for (int y = 0; y < size; ++y) { std::unique_ptr<png_byte[]> row(new png_byte[RGB * size * img_size]); for (int x = 0; x < size; ++x) { int idx = y * size + x; int bit = (qr->data[idx] & 1); for (int i = 0; i < img_size; ++i) { for (int j = 0; j < img_size; ++j) { row[3 * (x * img_size + j) + 0] = bit * red; .... } } } for (int i = 0; i < img_size; ++i) { png_write_row(png, row.get()); } } png_write_end(png, info); Can you please suggest how to achieve this without storing data into png file? I am not able to figure out how to display this in-memory QR Data without using png file.
  2. Vikash

    Draw QR Code

    Hi @Joel Bodenmann, Thank you. Can you please share some example how I can use gdispFillArea() to show QR Code. I am using below to get QR encoded string. QRcode *qr = QRcode_encodeString("Data", 0, QRecLevel::QR_ECLEVEL_M, QRencodeMode::QR_MODE_8, 1);
  3. Vikash

    Draw QR Code

    Hi, I have generated QR code like : QRcode *qr = QRcode_encodeString("Data", 0, QRecLevel::QR_ECLEVEL_M, QRencodeMode::QR_MODE_8, 1); Is it possible to display 'QR Code' directly without saving it to a file.
  4. Hi @Joel Bodenmann Thanks for the suggestion, we are able to successfully integrate CMake and compile µGFX with the suggested steps. 🙂
  5. So far I have make changes in CMakeLists.txt as below: 1. Removed this gfx_mk.c from CMakeLists.txt 2. set(GFXLIB /path/to/ugfx/library) 3. add_custom_target(run_ugfx_makefile COMMAND ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_SOURCE_DIR}/ugfx/gfx.mk WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ugfx ) 4. list(APPEND SOURCES ${GFXSRC}) 5. list(APPEND INCLUDE_DIRECTORIES ${GFXINC}) 6. add_dependencies(your_target run_ugfx_makefile)
  6. Hi Joel, Thank you for your reply. In my Project CMakeLists.txt, /src/gfx_mk.c is already added. So yes it is Single-file-inclusion. Can you please suggest which file I need to include in CMakeLists.txt? Also do I need to remove /src/gfx_mk.c? If there is no such file which specific µGFX source files I need to include in my existing build system (CMakeLists.txt).
  7. Hi, I am using uGFX v2.9, I am trying to use gdispPixmapCreate like below: // Create a pixmap and get a pointer to the bits pixmap = gdispPixmapCreate(PIXMAP_WIDTH, PIXMAP_HEIGHT); surface = gdispPixmapGetBits(pixmap); Getting error GDISPVMT_pixmap is undeclared, please suggest, do I need to enable some #define? Like I have set GDISP_NEED_PIXMAP to GFXON In file included from /ugfx/src/gdisp/gdisp_mk.c:23, from /ugfx/src/gfx_mk.c:18: /ugfx/src/gdisp/gdisp_pixmap.c: In function 'gdispPixmapCreate': gdisp_pixmap.c:83:35: error: 'GDISPVMT_pixmap' undeclared (first use in this function) 83 | g = (GDisplay *)gdriverRegister(&GDISPVMT_pixmap->d, p);
  8. Hi Joel, Thank you. We are able to achieve the above require points based on your feedback. 🙂
  9. Hi Joel, Sad to hear that. Please take care. Meanwhile, we are also working to achieve the above points.
  10. Hi Joel, Thank you. As per your suggestion we copied the existing tabset and modified it to show icons on Tab with this we are able to show icons on Tab. Attaching here working code. We need help in below: 1. In Tabs icons as well as text is showing up, if we try to remove the tab text, tab width is getting reduced. Please suggest how to make tab width constant. 2. We try to just show the icons, but it is not working. 3. Also, we are not able to align icons to the center of each tab, it is always showing at the top left corner of tab. software.zip
  11. I come up with this customTabsetAddTab(...) #include "gwin_custom_tabset.h" GHandle customTabsetAddTab(GHandle gh, gdispImage* icon) { // Verify that the handle is a custom tabset if (gh->vmt != (gwinVMT*)&tabsetVMT) return 0; CustomTabsetObject* to = (CustomTabsetObject*)gh; GHandle tabHandle; // Check if the number of tabs exceeds the maximum if (to->tabset.nTabs >= MAX_TABS) return 0; // Maximum number of tabs reached, cannot add more // Create a new tab tabHandle = gwinTabAdd(gh, "Tab", GWIN_TABHEIGHT, GWIN_TABHEIGHT, gTrue); // Set the tab's user pointer to store the icon gwinSetUserData(tabHandle, icon); // Add the icon to the custom tabset object to->icons[to->tabset.nTabs - 1] = icon; // Return the handle to the new tab return tabHandle; }
  12. Hi Joel, Thank you looking this out. I tried creating custom VMT for the Tabset based on example of statusbar. But its not working. I am attaching here my gwin_custom_tabset.h file and gwin_custom_tabset.c file, main.c file. Please confirm if I missed something. How we can achieve this? Also, what should be the corresponding implementation of customTabsetAddTab(...) gwin_custom_tabset.h gwin_custom_tabset.cpp main.c
  13. Thank you for your prompt reply. I tried with gwinSetCustomDraw, but image is not getting displayed over Tab instead of text. Also, as I have set NULL in text name like gwinTabsetAddTab(ghTabset, NULL, FALSE); Tabset is not displaying any text but Image is also not getting displayed and Tab width is now shrinked. Please suggest. void tap_page_image_renderer(GWidgetObject* obj, void* p) { const auto img = (gImage *)p; int16_t imgX = obj->g.x + (obj->g.width - img->width) / 2; int16_t imgY = obj->g.y + (obj->g.height - img->height) / 2; gdispGImageDraw(obj->g.display, img, imgX, imgY, -1, -1, 0, 0); } static void createWidgets(void) { GWidgetInit wi; // Prepare the images gdispImageOpenFile(&_home_img, "settings.gif"); // Apply some default values for GWIN gwinWidgetClearInit(&wi); wi.g.show = TRUE; // Create the Tabset wi.g.width = 200; wi.g.height = 200; wi.g.x = 10, wi.g.y = 10; ghTabset = gwinTabsetCreate(0, &wi, GWIN_TABSET_BORDER); ghPage1 = gwinTabsetAddTab(ghTabset, NULL, FALSE); gwinSetCustomDraw(ghPage1, tap_page_image_renderer, (void*)&_home_img); ghPage2 = gwinTabsetAddTab(ghTabset, NULL, FALSE); gwinSetCustomDraw(ghPage2, tap_page_image_renderer, (void*)&_home_img); ghPage3 = gwinTabsetAddTab(ghTabset, NULL, FALSE); gwinSetCustomDraw(ghPage3, tap_page_image_renderer, (void*)&_home_img);
  14. I am following below example to create Tabset. I want to show image in tab instead of text like "Page 1", "Page 2". Please suggest how to show image in Tab instead of Text. // Create the Tabset wi.g.width = 200; wi.g.height = 200; wi.g.x = 10, wi.g.y = 10; ghTabset = gwinTabsetCreate(0, &wi, GWIN_TABSET_BORDER); ghPage1 = gwinTabsetAddTab(ghTabset, "Page 1", FALSE); ghPage2 = gwinTabsetAddTab(ghTabset, "Page 2", FALSE); ghPage3 = gwinTabsetAddTab(ghTabset, "Page 3", FALSE);
×
×
  • Create New...