Changing colours

Naga
02-17-2005, 05:16 AM
I have a number of simple elements drawn in an off screen DC. Each one could be a different colour. All have been created using the GDI+ DrawLine function.

I then BitBlit this DC onto a multi-coloured background in a PictureBox.

Is there a quick way to change the colours of the elements without affecting the background colours and without having to redraw them all?

Thanks

Iceplug
02-17-2005, 06:01 AM
With what? Bitblt or GDI+?
You want to change the colors as it is drawn? Why is not having to redraw them a concern? What do you want to change the colors of and when?

Naga
02-17-2005, 07:30 AM
With what? Bitblt or GDI+?
You want to change the colors as it is drawn? Why is not having to redraw them a concern? What do you want to change the colors of and when?

The elements, which are simple rectangles (individually consisting of at most 2 colours), are drawn using GDI+ Drawline.

Imagine these rectangles as Containers in a Sea-Port area.

Initially they are drawn using a set of default colours - these colours represent some attribute of the elements - eg Country of Origin.

The user may choose to view a different attribute eg Destination (by State or by City, etc). So on a key press I want to change the colours to depict the new attribute chosen.

And... I have a coloured background (source a different DC) whose colours I wish to retain.

Re-draw is a potential concern due to speed limitations. (I have been disappointed by the performance of GDI+).

I seem to remember on the Atari ST being able to define a number of different colour palettes and being able to switch from one to another in sync with the screen refresh to radidly change the colours displayed. (I accept that this method would also change my background - see above - so perhaps I am expecting too much).

Thanks.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum