MobileWill Posted February 18, 2016 Report Share Posted February 18, 2016 Is there a way to draw pixels to a container and than show it? I tired but its blank. Only shows pixels that were drawn after it was visible. I am having a loading progress bar while everything is initialized and drawn. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted February 18, 2016 Report Share Posted February 18, 2016 When a widget that was hidden becomes visible it needs to be redrawn. For this, the GWIN module calls the currently assigned rendering routine of that widget. The container doesn't keep track of the internal state. It has no idea of what happens in its client area. This means that when you draw a pixel in the to the container (which is really discouraged, see below!) it will not know about it and the next time it redraws itself it won't redraw that pixel. As an opposite example: The console widget has an internal buffer that keeps track of the text that's shown. That way it can redraw the text when the window needs to be redrawn. A window doesn't keep state of your drawing operations. It would take tremendous amount of RAM to do that and as every other widget is based upon that window it would not be very suitable for embedded applications. This means that you can draw to the window but as soon as the window gets redrawn by GWIN it will be cleared again and you have to redo the painting. There's one simple and very recommended solution to your problem: Use Pixmaps. That is the most proper way to handle this. You can draw anything into the pixmap as it behaves like a real display. It even gives you access to the direct pixel values if you need to do some wizard magic. You can assign a pixmap as a background to a container using two different ways: Use gwinBlitArea() to dump the content of the pixmap to the container. This means that you will have to manually maintain the redrawing. Use the image rendering routine for the container widget and assign the pixmap image as the used image. That way it will take care of redrawing automatically. Use gdispPixmapGetMemoryImage() for that. Link to comment Share on other sites More sharing options...
MobileWill Posted February 19, 2016 Author Report Share Posted February 19, 2016 I would like to use pixmaps but I can't since I am not using the Makefile. Which is why I was trying to get Chibios Studio to work. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted February 19, 2016 Report Share Posted February 19, 2016 Did you follow our guide on how to use the ChibiStudio? There's a step-by-step guide that leads you through the process - it starts with downloading the appropriate Java version: http://wiki.ugfx.org/index.php/Using_ChibiStudio And if you don't like to use that very simplified Makefile we provide then follow the exact same guide but use the Makefile supplied by ChibiOS and modify it according to this guide: http://wiki.ugfx.org/index.php/Using_ChibiOS/RT Link to comment Share on other sites More sharing options...
MobileWill Posted February 19, 2016 Author Report Share Posted February 19, 2016 I did follow that guide and didn't get it working other than a few of the demos. I couldn't get an other headers to be included. But as my other comment mentioned I make progress with Embitz and the make system. So this weekend I should be able to get hopefully my project working and then try pixmaps. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now