gdi

jawadh90

Member
Joined
Jun 19, 2003
Messages
18
Hi there. I am a intermediate programmer in VB.NET who needs some help with our project. I have been working on this for about a week now. This project involves putting images on top of another without flickering. Basically, what were doing here is we have an gauge image then we need to have gauge labels and ticks on top of it. After that, we need to put the needle image on top of all of it. When a user points and clicks on a particular spot in the gauge, say at 70, the needle will go to that spot. Also there are some textboxes that they can input various numbers such as min and max value of the gauges, how many ticks and increments. Ive tried using different things and it seems it doesnt work. I looked at double buffering but I dont have any clue on how to use it. Another method I tried was GraphicPath, but it seems not working for me. Can anybody give me a sample code that would make my life a bit simple.
 
attach your project and ill fix it

ok heres how to do double buffering, iirc: in form1.paint
Code:
SetStyle(controlstyles.Doublebuffer,True) Lowers flicker
Setstyle(controlstyles.allpaintinginWMPaint,True) lowers flicker  even more
[code=vb]

its not exact... but its similar, use the popupbox that appears when you type SetStyle(

it will say something like controlstyles.doublebuffer

good luck with ur app/proj ;)
 
i did that

SetStyle(ControlStyles.DoubleBuffer, True)
SetStyle(ControlStyles.UserPaint, True)
SetStyle(ControlStyles.AllPaintingInWmPaint, True)
i already used this in my program but unfortunately it still gives me flickering. the problem is that when the gauge is laid inside the picturebox and then the ticks and label, there no flickering. once i set the needle an try to move it redraws the labels and ticks over again. how could i prevent this from happening. ive also tried to load the images into memory (initializing it inside form load and using it there). ive also tried to break it apart. if i have the gauge image and the labels/ticks it doesnt flicker, if i have the gauge and needle together it doesnt flicker. but if ihave all three of them them thats when the problem occur.
 
here

this is almost the same as the one that i am working on
this is my trial project because i dont wanna mess things up with the one i have. my gauge project works, its just that flickering business. so you could look at this project.
 

Attachments

by the way

u could just take the picture box off if you want.
also, could you use pictureboxes with my project. and could you use layering inside pictureboxes.
 
thankx

thankx thepentiumguy. that really helped alot. i hope next tyme you could help me again. ill try to fix my gauge project and apply the code you gave me. thankx once again.
 
Back
Top