Click here to Skip to main content
15,904,156 members
Home / Discussions / C#
   

C#

 
GeneralRe: Projects/Libraries On Tuning? Pin
Brandon X.29-Dec-08 8:10
Brandon X.29-Dec-08 8:10 
GeneralRe: Projects/Libraries On Tuning? Pin
Ravadre29-Dec-08 8:16
Ravadre29-Dec-08 8:16 
QuestionRe: Projects/Libraries On Tuning? [modified] Pin
Brandon X.29-Dec-08 19:29
Brandon X.29-Dec-08 19:29 
AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre30-Dec-08 4:42
Ravadre30-Dec-08 4:42 
QuestionRe: Projects/Libraries On Tuning? [modified] Pin
Brandon X.31-Dec-08 10:24
Brandon X.31-Dec-08 10:24 
AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre31-Dec-08 12:35
Ravadre31-Dec-08 12:35 
QuestionC# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom27-Dec-08 13:44
spamoom27-Dec-08 13:44 
AnswerRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
Richard Andrew x6427-Dec-08 14:45
professionalRichard Andrew x6427-Dec-08 14:45 
QuestionRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom28-Dec-08 0:13
spamoom28-Dec-08 0:13 
AnswerRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
Richard Andrew x6428-Dec-08 1:36
professionalRichard Andrew x6428-Dec-08 1:36 
GeneralRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom28-Dec-08 2:04
spamoom28-Dec-08 2:04 
Question[Message Deleted] Pin
TwoSocks27-Dec-08 13:40
TwoSocks27-Dec-08 13:40 
Questionlock the windows xp Pin
abu rakan27-Dec-08 12:06
abu rakan27-Dec-08 12:06 
AnswerRe: lock the windows xp Pin
User 665827-Dec-08 13:00
User 665827-Dec-08 13:00 
Questionavi file Pin
manishkumarcse27-Dec-08 11:57
manishkumarcse27-Dec-08 11:57 
GeneralRe: avi file Pin
Luc Pattyn27-Dec-08 12:38
sitebuilderLuc Pattyn27-Dec-08 12:38 
AnswerRe: avi file Pin
Code Soldier28-Dec-08 5:25
Code Soldier28-Dec-08 5:25 
QuestionDatabase update error help Pin
hatan8627-Dec-08 9:39
hatan8627-Dec-08 9:39 
AnswerRe: Database update error help Pin
Colin Angus Mackay27-Dec-08 9:57
Colin Angus Mackay27-Dec-08 9:57 
GeneralRe: Database update error help Pin
hatan8627-Dec-08 10:18
hatan8627-Dec-08 10:18 
GeneralRe: Database update error help Pin
Colin Angus Mackay27-Dec-08 10:38
Colin Angus Mackay27-Dec-08 10:38 
QuestionPaint drawing multiple layers Pin
Chris Copeland27-Dec-08 5:48
mveChris Copeland27-Dec-08 5:48 
Hey.

I've created a control which allows users to draw "tiles" onto a canvas, and supports multiple layers.

I've been running diagnostic time checks on each of these. The problem is, the system draws "previews" (50% transparency images of the other layers) when another layer is selected, so the person can see where the other tiles/sprites are on the canvas.

I have it set so that only the region of the canvas where a sprite has been painted is invalidated and updated when the user paints onto the canvas. But the problem is that it still requires quite a bit of rendering.

I have set DoubleBuffering to true, enabled OptimizedDoubleBuffering, AllPaintInWmPaint etc. Here are some times:

When drawing the entire map without transparency on layers: 0.23 seconds.
When drawing one layer, other layers with transparency: 0.8 seconds.
When painting a tile onto part of a layer: 0.26 seconds.

This might seem moderately fast for a drawing system, but for some reason the drawing is lagging. The painting itself isn't lagging at all, but it's the rendering the output onto the control that seems to take a while. You see, I have a selector box that's 2px wide rectangle that follows the mouse on the map to show where the sprite will be painted, and it takes a while to update the position.

Is there any way I could speed up the processing of my control? I know it's a hefty load to be drawing onto a control (especially 3~4 layers, where 2~3 of them are drawn with 50% transparency), but there are other editors which perform the same function and don't lag at all (or atleast take around 0.2 seconds to render transparent layers.

Edit

Just as a point of interest, would it speed up my processing if I split each layer into seperate controls, placed on top of each other on my main edit control, then drawing each layer seperately on each control, rather than having them all parsed in the same control?

Thanks ~ Chris.
Questiontablelayoutpanel into usercontrol Pin
Michael Yip27-Dec-08 4:27
Michael Yip27-Dec-08 4:27 
QuestionImage plotting problem Pin
Silvyster27-Dec-08 3:48
Silvyster27-Dec-08 3:48 
AnswerRe: Image plotting problem Pin
User 665827-Dec-08 3:59
User 665827-Dec-08 3:59 

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.