Click here to Skip to main content
15,881,381 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: IrDA with .NET Pin
leppie2-May-03 8:51
leppie2-May-03 8:51 
GeneralRe: IrDA with .NET Pin
Daniel Strigl2-May-03 9:05
Daniel Strigl2-May-03 9:05 
Generalvirtual methods on existing value types Pin
Ben Watson1-May-03 17:39
Ben Watson1-May-03 17:39 
GeneralRe: virtual methods on existing value types Pin
James T. Johnson1-May-03 17:57
James T. Johnson1-May-03 17:57 
Generalpaint application question Pin
lfsong30-Apr-03 0:41
lfsong30-Apr-03 0:41 
GeneralRe: paint application question Pin
J. Dunlap30-Apr-03 8:31
J. Dunlap30-Apr-03 8:31 
GeneralRe: paint application question Pin
lfsong1-May-03 17:55
lfsong1-May-03 17:55 
GeneralRe: paint application question Pin
James T. Johnson1-May-03 18:06
James T. Johnson1-May-03 18:06 
LynnSong wrote:
If I draw on the deeper layer(panel), the stokes/shapes on upper layer(panel) will form a mask that cover the strokes/shapes I am drawing.

So you have one panel for each layer of your image? Dead | X|

You would be better off having one control and have a property on that control to tell it which layer (ie bitmap) should be modified when you 'draw' on it. Then in the constructor for that control set the double buffer style bits (this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);).

Now you just need to make the mousedown/mousemove events modify the image and call invalidate with the changed area while OnPaint does the drawing (hopefully smartly, ie change no more than needs to be drawn).

The OnPaint would just go through each bitmap and draw it on the Graphics object passed in.

Optimizations left to you of course Wink | ;)

James

"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation

GeneralRe: paint application question Pin
lfsong2-May-03 5:30
lfsong2-May-03 5:30 
GeneralRe: paint application question Pin
James T. Johnson2-May-03 14:57
James T. Johnson2-May-03 14:57 
GeneralRe: paint application question Pin
lfsong2-May-03 19:03
lfsong2-May-03 19:03 
GeneralRe: paint application question Pin
James T. Johnson2-May-03 23:00
James T. Johnson2-May-03 23:00 
GeneralRe: paint application question Pin
lfsong4-May-03 18:46
lfsong4-May-03 18:46 
GeneralRe: paint application question Pin
J. Dunlap4-May-03 18:57
J. Dunlap4-May-03 18:57 
GeneralRe: paint application question Pin
lfsong4-May-03 22:52
lfsong4-May-03 22:52 
GeneralRe: paint application question Pin
James T. Johnson4-May-03 19:05
James T. Johnson4-May-03 19:05 
GeneralRe: paint application question Pin
J. Dunlap4-May-03 19:36
J. Dunlap4-May-03 19:36 
GeneralRe: paint application question Pin
James T. Johnson4-May-03 20:24
James T. Johnson4-May-03 20:24 
GeneralRe: paint application question Pin
J. Dunlap4-May-03 20:29
J. Dunlap4-May-03 20:29 
GeneralRe: paint application question Pin
lfsong4-May-03 23:36
lfsong4-May-03 23:36 
GeneralRe: paint application question Pin
James T. Johnson5-May-03 1:01
James T. Johnson5-May-03 1:01 
QuestionAm I running as a native image? Pin
solidstore29-Apr-03 1:20
solidstore29-Apr-03 1:20 
AnswerRe: Am I running as a native image? Pin
Stephane Rodriguez.29-Apr-03 2:18
Stephane Rodriguez.29-Apr-03 2:18 
GeneralLow level network application Pin
Andrei Matei28-Apr-03 22:29
Andrei Matei28-Apr-03 22:29 
GeneralRe: Low level network application Pin
Andy Davey29-Apr-03 16:16
Andy Davey29-Apr-03 16:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.