Best way to avoid flickering when redrawing VGA image??


J

juvi

Hello,

I have got an image (vga resolution) stored in:

Image BGImage;

When my program is launching then the picturebox1.image is set to BGImage.
After that I am drawing some transparent images and text with opennetcf and
cf.

For the first time it is ok, but when something changes and I must redraw
then the image will be disposed and reloaded again with the method described
above. After that I am redrawing again everything on this picturebox.image.

The result is a flickering effect....what could be the performance problem
and how could I avoid this flickering???

thx
juvi
 
Ad

Advertisements

C

Chris Tacke, eMVP

You've not given us much to go on, so I'll give the stock answer for
eliminating flicker. Use double buffering. Cache the bitmap.

--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
J

juvi

hello and thank you for your reply.

I am not common with double buffering and bitmap caching. How can I do this?
(I know that these question may be some "noob" questions, but everybody can
be confronted with new things sometime)

thank you
juvi
 
C

Chris Tacke, eMVP

It's beyond the scope of a newsgroup post. There are plenty of online
tutorials and examples. Just do a search for double buffering.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
Ad

Advertisements

S

Simon Hart [MVP]

You basically write all the screen output to an in-memory bitmap, then when
you're finished, write this bitmap to the screen (disp adapter).
 
J

juvi

Thank youf all for just giving more help. I tried now the following:

I declared:

Bitmap BuffBitmap; // I use this as bitmap to draw on
Graphics graphics; //graphics from BuffBitmap
Graphics REALgraphics; //graphics from PictureBox.Image

When I do my drawing with "graphics" I end my drawings with
REALgraphics.DrawImage(....BuffBitmap...)....
Now it does not flicker as much as before, but the performance is also going
back.

I am not sure if I may ask someone to maybe look into my projects code?

thx for any help
juvi

:
 
S

Simon Hart [MVP]

Please post the relevant code, I don't understand what you are trying to do
from what you said.
 
J

juvi

If you agree I would prefer to send you the whole project to your blogs pm
address, because if I only insert some code snippets here it will not be
understandable and there is a lot of code....If you do not want it I will try
to find the relevant code to post but the first option would be easier....

juvi
 
Ad

Advertisements

Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Flicker on redrawing 1
Avoid Flickering 1
Image Flicker 2
Label: how to avoid flicker? 4
The best way? 1
VGA Displays, images ,Landscape 0
VGA or not VGA 1
Where to redraw a region of an image drawed in OnPaint() ? 2

Top