Color Picker-Flicker

I have 2 controls:

- TrackBar
- TImage

I'm using TImage Canvas and fill it with some colour.
As I move trackbar, the colour should change, let's say the Red changes as the trackbar changes.

The problem is that the image flickers badly. How can I fix it, or, is there another way of doing it?

Graga
gragaAsked:
Who is Participating?
 
Slick812Connect With a Mentor Commented:
why are you using a TImage? You don't use an Image (Bitmap). Try using a TShape, and change the color of it's brush or use a TPaintBox and change the color of it's canvas (with Rectangle or fillRect). TImage has alot of flickering problems, if you draw on it's canvas. TPaintbox is better to use if u draw on the canvas,, but TShape is good for a solid color.
0
 
gragaAuthor Commented:
I have changed the component to TPainBox. I'm drawing the shape using LineTo and then fill it using FloodFill (I need to have 2 shapes of different colors.
Flickering is the same as with TImage.
0
 
Slick812Commented:
can you show the code you use? ?
0
 
gragaAuthor Commented:
Actually, solved it. When I draw the border once only and then just fill it, there is no flickering.
Thanx
0
All Courses

From novice to tech pro — start learning today.