Search Results

Search results 1-20 of 30.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Emwin image draw

    LexaGb - - emWin related

    Post

    Hello, yes, widgets are by nature windows themselves. So you can use size related functions WM_ResizeWindow() / WM_SetSize() / WM_SetXSize() / WM_SetYSize()... to resize an IMAGE widget. Alex.

  • create scrollbar for image

    LexaGb - - emWin related

    Post

    Hello, Yes, you can do without userdata getting a scrollbar value in WM_PAINT. In the previous example the scrollbar attached to the image as a child widget therefore its location is inside the image and takes up the image space. In order to avoid covering the image you can either increase XSize of the image by the scrollbar size or create the scrollbar as a sibling widget to the image not as a child also in GUIBuilder. I simply changed the code to do accordingly. Alex.

  • create scrollbar for image

    LexaGb - - emWin related

    Post

    Hello, for scrolling a bitmap I'd create that bitmap as an IMAGE widget, not just drawing it with GUI_DrawBitmap(). Then you can attach scrollbar to the IMAGE widget and set custom callback function to the widget for scrollbar handling. Try the code attached. There is a WINDOW widget with a child IMAGE widget and vertical scrollbar attached. And you need to recalculate scrolling coefficient according to your image and scrollbar configuration. Alex.

  • Emwin image draw

    LexaGb - - emWin related

    Post

    Hello, functions GUI_MEMDEV_CopyToLCD...() ingnore the alpha channel. If you want to consider the transparency then use GUI_MEMDEV_WriteAt() instead of GUI_MEMDEV_CopyToLCDAt(). Alex.

  • Emwin image draw

    LexaGb - - emWin related

    Post

    Upd. If you do not want to draw the whole image on the screen before copying a half in memory device then you can use another memory device for drawing. This results in only half image displayed on the screen: C Source Code (45 lines) Alex.

  • Emwin image draw

    LexaGb - - emWin related

    Post

    Hello, as I noticed the first approach is working for uncompressed bitmaps. If your bitmap is compressed (RLE etc) then it may end with incorrect drawing due to complex compressed data structure. Further it may concern also uncompressed bitmaps. Nevertheless, I'd use memory devices for that. This relieves you of image format as you copy already drawn pixel data. I simply changed the code cause I think that drawing the whole image to the half memory device may result with damaging data outside th…

  • Emwin image draw

    LexaGb - - emWin related

    Post

    Hello, there maybe a way to copy a bitmap structure and change XSize to a half of original size, something like this: C Source Code (34 lines) As far as I understand it is working with uncompressed bitmaps. Maybe a way better is to use memory devices: C Source Code (40 lines) Alex.

  • Hello, emWin reference guide, chapter 19.4.6 "KNOB API", function KNOB_SetDevice(): "Sets a memory device which contains a drawn knob. This drawing defines the appearance of the knob." So you need first to create memory device at least for the knob image and then attach it to the widget. Add memory device handler variable: GUI_MEMDEV_Handle hMem; Add this code to the WM_INIT_DIALOG handler. This draws a simple knob in memory device and attach it: // Create Memory Device 32bpp hMem = GUI_MEMDEV_C…

  • Hello, you can add new leaf below selected but its going to be a big difficult code to handle "main" leaf and its "info" leaf in conjunction. Instead of this I'd change the size of selected leaf then draw upper (for item) and lower (for info) rects and then add the info text in the lower rect. I attached the code and this code is also not to say simple. It works around with item coordinates, item hadlers array and makes up user data to pass when handling commands. Initial code created in GUIBuld…

  • Hello, in case you set indentation of item text to 0 then text is covered by item images. I think it is because default drawing function first draws item text and after that it draws images. To change the order I think custom drawing function can be set where you should "do nothing" when handling text drawing command (WIDGET_ITEM_DRAW_TEXT) and sort of "repeat" text drawing after drawing item image when handling image drawing command (WIDGET_ITEM_DRAW_BITMAP). I think treeview items can be disti…

  • Provide the source code regarding creating these parent and child windows and using WM_PAINT in it. Without the code it's a kind of fortune-telling.

  • Hello, what is your FONT_10? Is this a custom font created in Font Converter or standart font from emWin package? Whether the symbol '°' (ascii code 0xB0) and other symbols you tried to display contained in this font? Can you provide more source code regarding the font and windows created and using this font in WM_PAINT? Alex.

  • center spinbox text

    LexaGb - - emWin related

    Post

    Hello, SPINBOX widget has an embedded EDIT widget. I think the simplest way is to get a handle of the EDIT and call EDIT_SetTextAlign() something like this: C Source Code (30 lines)Alex.

  • GUI_AA_FillCircle acting strange.

    LexaGb - - emWin related

    Post

    Hello, I think it's because your y0 parameter in your GUI_AA_FillCircle() is not a multiple of the factor (4) you selected when using hi-res coordinates. Setting y0 to a closest multiple value (236 or 240) solves this problem on my side. Also you are using "STemWin_***_ARGB.a" library and I noticed that setting circle color to a blue shows red circle on your screenshot. You need either to change lib file to "STemWin_***_ABGR.a" or configure special macro in a header file for using argb mode. Ale…

  • GRAPH horizontal resolution

    LexaGb - - emWin related

    Post

    Hello, here is a little sample code. There is a graph with the radio and simple buttons attached. Radio button switches the drawing modes (default (100 points) / scaled (500 points)) and simple button regenerates data array. For drawing curve in scaled mode user draw routine is used. C Source Code (125 lines) Alex.

  • Hello, yes, if your EDITs don't contain transparency and you sure know the colors of the text and background then your approach is much more easy. Alex.

  • Hello, to hide the cursor you could try to use EDIT_EnableInversion() with setting cursor background color as transparent and enabling transparency in WM_PAINT message sent to EDIT widgets. I modified your code like this: C Source Code (126 lines) At least it works in my simulator from STemWin 5.32 package. Alex.

  • Hello, DROPDOWN_InsertString() in conjunction with DROPDOWN_DeleteItem() can be used for this purpose. I'd do something like that: C Source Code (52 lines) Alex.

  • button and wrap

    LexaGb - - emWin related

    Post

    Hello, you can use skinning option for BUTTON widget and handle text drawing command calling GUI_DispStringInRectWrap() function. C Source Code (86 lines)

  • Hello, Sven, Yes, indeed I thought so that its about memory devices. I tested GUI_MEMDEV_PunchOutDevice() and in case of text it might give interesting effects, for example, gradient on the frame... Thank you for your example.