Fabien Comte Posted November 24, 2017 Report Posted November 24, 2017 Hello, I try to use a pixmap on a background without success. i have an image preloaded in myimage and i imagined that the next sequence load it in pixmap but it looks like that it reads pixmap. My question is how to load a file into a pixmap ? mypixmap = gdispPixmapCreate(CONTAINER_WIDTH, CONTAINER_HEIGHT); gdispImageOpenMemory(&myimage, gdispPixmapGetMemoryImage(mypixmap _selection));
Joel Bodenmann Posted November 27, 2017 Report Posted November 27, 2017 You don't need a pixmap in this case. You can simply cache the image using gdispImageCache(). A cached image is stored as a decompressed bitmap just like it would in the pixmap with the simple benefit that in some cases, some really basic RLE will be applied that decreases the image size without having a real impact on the rendering performance. To answer your question anyway: You render to a pixmap like you would to any other display. A pixmap is nothing but a virtual display. You use all the normal GDISP rendering calls. Therefore, you can render an image to a pixmap using the regular gdispGImageDraw() function. The wiki demonstrates rendering to a pixmap: https://wiki.ugfx.io/index.php/Pixmaps
Fabien Comte Posted November 29, 2017 Author Report Posted November 29, 2017 Hello, There is Something Strange with your response. Why if i load a file as JPG or PNG (same image, same resolution) i get different performance if it's uncompressed in cache* ? * i load images on startup.
Joel Bodenmann Posted November 29, 2017 Report Posted November 29, 2017 Did you check the return value of the gdispImageCache() function call? An image decoder can refuse to cache the image. An image also won't be cached if there's not enough memory left.
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