How can I repair parts of an image?
The TFT library has a partial draw function, but it's always starting at top/left of the image
If an object changes (e.g. a displayed time) the background has to be redrawn before the
new information can be displayed. To draw the full image and redraw all the objects on it
takes to much time.
I need a function to redraw an image from (rx1,ry1) to (rx2,ry2).
If I need to write it myself , I need information about the bitmap format in TFT library
Any help is appreciated
How can I redraw a partial TFT image
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: How can I redraw a partial TFT image
Hi Mike,
If you need to update some label there are several ways of doing it,
for example you can write previous value in background color,
and write new value with another color.
You can take a look here:
https://shop.mikroe.com/stretch-click
Or for example, you can draw rectangle of background color
across old value, and then write new value.
Or you can write functions for updating labels.
Kind regards,
Lana
If you need to update some label there are several ways of doing it,
for example you can write previous value in background color,
and write new value with another color.
You can take a look here:
https://shop.mikroe.com/stretch-click
Or for example, you can draw rectangle of background color
across old value, and then write new value.
Or you can write functions for updating labels.
Kind regards,
Lana
Re: How can I redraw a partial TFT image
Hello Lana
thank you, but I know these methods. I think you misunderstood my question.
The background isn't a monocolored rectangle, it's an image in the background,
so I have to redraw the image bmp inside an invalidated rect.
I'm showing technical processes in this application, and a full redraw is to slow and looks unprofessional.
All I need is
procedure TFT_Partial_Image (left, top, STARTLEFT,STARTTOP, width, height : word; image : ^const byte; stretch : word) ;
My opinion:
The TFT library is so individual, depending on hardware and application, it should be open source.
Mike
thank you, but I know these methods. I think you misunderstood my question.
The background isn't a monocolored rectangle, it's an image in the background,
so I have to redraw the image bmp inside an invalidated rect.
I'm showing technical processes in this application, and a full redraw is to slow and looks unprofessional.
All I need is
procedure TFT_Partial_Image (left, top, STARTLEFT,STARTTOP, width, height : word; image : ^const byte; stretch : word) ;
My opinion:
The TFT library is so individual, depending on hardware and application, it should be open source.
Mike
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: How can I redraw a partial TFT image
Hi Mike,
I'm sorry, I obviously misunderstood you.
If you need to redraw image from (rx1,ry1) to (rx2,ry2),
did you try to set parameters in TFT_Partial_Image as:
Kind regards,
Lana
I'm sorry, I obviously misunderstood you.
If you need to redraw image from (rx1,ry1) to (rx2,ry2),
did you try to set parameters in TFT_Partial_Image as:
Code: Select all
TFT_Partial_Image(rx1, ry1, rx2-rx1, ry2-ry1, @image, 1);
Lana
Re: How can I redraw a partial TFT image
Hi Lana
you are calculating the image width and height and write the image at another loation
This has no effect on the starting coordinates inside the image
The function is always starting with the upper left corner of the image and that's
my problem.
An Example
If this is a bmp image:
###########
###########
########*##
###########
How do I draw the star only?
The tft partial function is only mooving the whole pic on the screen
Regards Mike
you are calculating the image width and height and write the image at another loation
This has no effect on the starting coordinates inside the image
The function is always starting with the upper left corner of the image and that's
my problem.
An Example
If this is a bmp image:
###########
###########
########*##
###########
How do I draw the star only?
The tft partial function is only mooving the whole pic on the screen
Regards Mike
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: How can I redraw a partial TFT image
Hi Mike,
I'm sorry for misunderstanding.
I forwarded your suggestion to our developers for consideration.
Kind regards,
Lana
I'm sorry for misunderstanding.
I forwarded your suggestion to our developers for consideration.
Kind regards,
Lana
Re: How can I redraw a partial TFT image
Hello Lana.
My problem is that I've to finish the project and time is running...
Please send me the structure of the bitmap headers used
in the TFT library ressources. They are different to bitmap files.
So I can write my own function.
regards Mike
My problem is that I've to finish the project and time is running...
Please send me the structure of the bitmap headers used
in the TFT library ressources. They are different to bitmap files.
So I can write my own function.
regards Mike
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: How can I redraw a partial TFT image
Hi Mike,
You may find this converter useful:
https://libstock.mikroe.com/projects/vi ... -converter
Kind regards,
Lana
You may find this converter useful:
https://libstock.mikroe.com/projects/vi ... -converter
Kind regards,
Lana
Re: How can I redraw a partial TFT image
Hi Lana
nice Program, but this is no answer to my question!
I already have the bitmap ressources in my program in use with TFT Library.
What I need to proceed is the data structure of the bitmaps in Micropascal
(especially the headers) to write my draw function
Please ask a develloper, he knows what I need.
regard Mike
nice Program, but this is no answer to my question!
I already have the bitmap ressources in my program in use with TFT Library.
What I need to proceed is the data structure of the bitmaps in Micropascal
(especially the headers) to write my draw function
Please ask a develloper, he knows what I need.
regard Mike
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: How can I redraw a partial TFT image
Hi Mike,
It has bitmap file header (0x00), then how much bits per pixels, then width and height, then
if image is less than 16bpp it has palette or if image is 16bpp it has data as 2 bytes for each pixel.
Kind regards,
Lana
It has bitmap file header (0x00), then how much bits per pixels, then width and height, then
if image is less than 16bpp it has palette or if image is 16bpp it has data as 2 bytes for each pixel.
Kind regards,
Lana
Re: How can I redraw a partial TFT image
Hi Lana,
thank you, this was helpful to solve the problem.
With this information I could write a function an can
finish the project.
By the way, I'm generally disapointed about the superficial documentation.
Such informations should be found. For beginners who don't care about
details it's ok. But for professional developers ist not enough.
Regarding the TFT library for example, there are a lot of functions
to set pen, brush, font etc. I was looking for a fontheight. There is
an existing variable in the debugger, but not accessable. So I read byte 6
in the font table to obtain the value, an unnecessary work around .
Why do you hide all these variables and informations? A good documentation
could save a lot of time in developement
Regards Mike
thank you, this was helpful to solve the problem.
With this information I could write a function an can
finish the project.
By the way, I'm generally disapointed about the superficial documentation.
Such informations should be found. For beginners who don't care about
details it's ok. But for professional developers ist not enough.
Regarding the TFT library for example, there are a lot of functions
to set pen, brush, font etc. I was looking for a fontheight. There is
an existing variable in the debugger, but not accessable. So I read byte 6
in the font table to obtain the value, an unnecessary work around .
Why do you hide all these variables and informations? A good documentation
could save a lot of time in developement
Regards Mike
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: How can I redraw a partial TFT image
Hi Mike,
Thank you for your suggestions,
and I'm sorry for the lack of information.
Help file is written on that way to be concise,
but to provide enough information for using the functions.
But I will forward to our developers to consider to
add information which you have suggested.
Kind regards,
Lana
Thank you for your suggestions,
and I'm sorry for the lack of information.
Help file is written on that way to be concise,
but to provide enough information for using the functions.
But I will forward to our developers to consider to
add information which you have suggested.
Kind regards,
Lana