Click here to Skip to main content
15,887,361 members
Home / Discussions / C#
   

C#

 
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 
Questionfetching unknown values from the database Pin
nishu00727-Dec-08 2:52
professionalnishu00727-Dec-08 2:52 
AnswerRe: fetching unknown values from the database Pin
Wendelius27-Dec-08 3:55
mentorWendelius27-Dec-08 3:55 
Questionhow to edit @ of legend using crystalreports with vs2008 Pin
vishnukamath27-Dec-08 2:30
vishnukamath27-Dec-08 2:30 
QuestionMicrosoft Web Browser - no scroll bars and no right click? Pin
aleXXXka27-Dec-08 1:26
aleXXXka27-Dec-08 1:26 
AnswerRe: Microsoft Web Browser - no scroll bars and no right click? Pin
spamoom28-Dec-08 0:25
spamoom28-Dec-08 0:25 
GeneralRe: Microsoft Web Browser - no scroll bars and no right click? Pin
aleXXXka28-Dec-08 3:53
aleXXXka28-Dec-08 3:53 
AnswerRe: Microsoft Web Browser - no scroll bars and no right click? Pin
spamoom28-Dec-08 5:32
spamoom28-Dec-08 5:32 
GeneralRe: Microsoft Web Browser - no scroll bars and no right click? Pin
aleXXXka28-Dec-08 7:18
aleXXXka28-Dec-08 7:18 
Questiondatagridview using c# Pin
kulandaivel_mca200726-Dec-08 22:47
kulandaivel_mca200726-Dec-08 22:47 
AnswerRe: datagridview using c# Pin
Brij26-Dec-08 23:34
mentorBrij26-Dec-08 23:34 
GeneralRe: datagridview using c# Pin
kulandaivel_mca200727-Dec-08 0:06
kulandaivel_mca200727-Dec-08 0:06 
AnswerRe: datagridview using c# Pin
andhare27-Dec-08 1:44
andhare27-Dec-08 1:44 
QuestionHow to read Hebrew letters with StreamReader Pin
Admin88726-Dec-08 22:39
Admin88726-Dec-08 22:39 
AnswerRe: How to read Hebrew letters with StreamReader Pin
Lev Danielyan27-Dec-08 0:59
Lev Danielyan27-Dec-08 0: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.