views:

483

answers:

2

I have a Windows Form Application in Visual Studio 2008 - PictureBox.Refesh() method causes a delay when drawing on a PictureBox. Is there any method that gives the same result without delay?

A: 

Without delay? Invalidate() works too, but remember... don't use refresh() on the whole form, specify it... Maybe that's causing the delay (I don't see delays like that, are you reading the image from where?)

EDIT: I was building a project and PNG's 8-bit alpha blending was not playing nice with winforms. Open my app and see if you have that flickering when you resize:
http://www.mediafire.com/?rnj25my2ygd

Camilo Martin
i am making a bmpimage by the file data and then putting it in picture box and then want to make a rectangle selection of particular region of drawing to show that selection i need a refres of screen.
moon
invalidate() is not working on it buddy!
moon
can you help me any more?
moon
Hum... is the file being reloaded? =/ What kind of delay are you getting? the re-drawing is so fast that it's drawn as you resize it, so it's really fast. I believe there is a bottleneck somewhere else. What about putting the image in an imagelist and assigning it to the picturebox?
Camilo Martin
Also, are you using 1 bit of alpha transparency, or more? Since .NET WinForms is very slow on alpha transparency compared to a browser.
Camilo Martin
A: 

i have solved my problem my self

i just set a timer and on its event i have updated my image and the timer interval is set as i desired to 100 miliseconds now my application is running so smoothly any one up with this problem try this it works for me

regards:

moon
Good for you because I still don't understand what the question was =/
Camilo Martin
no need understand it now i have solved the problem keep sleeping buddy,
moon