cancel
Showing results for 
Search instead for 
Did you mean: 

Can part of an image be drawn and invalidated?

scottSD
Senior III

I need to draw part of an image. I found the following function:

0690X00000As0aRQAR.png

I have tried the image.draw() method and it does work. However, I am having issues with it because I am placing a progress widget behind it which invalidates that area and essentially wipes out the drawn image.

I have tried calling draw() after advancing the progress value of the widget, but it flickers. And calling image.invalidate() displays the entire image (not the partial rectangle set by the draw() method.

2 REPLIES 2
scottSD
Senior III

I have tried the HAL method drawDrawableInDynamicBitmap() to copy part of the Image drawable into a Dynamic Bitmap and then use this dynamic bitmap in a new image.

This works if the images are setup as RGB565 but not other formats. I assume this is because RGB565 is the format being used inside the Image widget before being copied to the frame buffer?

I would like to use the new L8_ARGB8888 for Dynamic Bitmaps and then be able to copy part of L8_ARGB8888 images into them. Is this possible with the TouchGFX framework, or am I going to have to write my own?

Hi,

If you want to only invalidate a certain area of a image, you can use invalidateRect(Rect& invalidatedArea), which invalidates the area specifies by a Rect and as with draw, the are that is invalidated based on the Rect's properties which is relative to the image

/Emil