Click here to Skip to main content
16,006,535 members
Home / Discussions / C#
   

C#

 
AnswerRe: how i can make remote backup server using C# Pin
led mike25-Mar-08 5:55
led mike25-Mar-08 5:55 
QuestionHow to add text in richtextbox from rtf file? Pin
Aravinthan25-Mar-08 5:51
Aravinthan25-Mar-08 5:51 
AnswerRe: How to add text in richtextbox from rtf file? Pin
led mike25-Mar-08 5:56
led mike25-Mar-08 5:56 
GeneralRe: How to add text in richtextbox from rtf file? Pin
Aravinthan25-Mar-08 6:30
Aravinthan25-Mar-08 6:30 
QuestionGDI+ Invalidate() artifacts Pin
Herbertmunch25-Mar-08 5:29
Herbertmunch25-Mar-08 5:29 
GeneralRe: GDI+ Invalidate() artifacts Pin
vineas25-Mar-08 7:04
vineas25-Mar-08 7:04 
GeneralRe: GDI+ Invalidate() artifacts Pin
Herbertmunch25-Mar-08 9:32
Herbertmunch25-Mar-08 9:32 
GeneralRe: GDI+ Invalidate() artifacts Pin
vineas25-Mar-08 11:49
vineas25-Mar-08 11:49 
Herbertmunch wrote:
Thats what the first invalidate does! When you call invalidate, it wont invalidate immediately. If you were to call refresh() then it would go straight to the paint code, but this way it just carries on executing the next instruction.


Yep, you're right - it's been a while since I've done much with GDI apparently, and I forgot that. However, Refresh is a bit more heavy handed - it will invalidate everything then force a redraw - if you only want to force the redraw the invalidated regions, use the Update method. Not that this matters to the issue at hand ...


Anyway, I loaded this up in a test project just to see what was going on - I should have done this right away but was too lazy Smile | :) Anyway, it looks like what you're seeing is from the draw rectangle actually drawing one pixel past the edge of the rectangle (you can see this easier if you make the rectangle width to be 1, you'll see a two pixel wide line drawn). What you'll want to do is just to invalidate an area slightly larger than your rectangle - so your both of your invalidates should so something like: Invalidate(Rectangle.Inflate(r, 2, 2)). Then, assuming your paint has been updated to fill the clip region, all is working correctly.

The reason you need to invalidate an area larger than the rectangle on the second invalidate as well as the first is becauase of the same issue - the pen draws one pixel to the right and one down from the actual rectangle, causing the rectangle to be clipped if moving to the right or down.

-----
In the land of the blind, the one eyed man is king.

GeneralRe: GDI+ Invalidate() artifacts Pin
Herbertmunch27-Mar-08 9:49
Herbertmunch27-Mar-08 9:49 
Generaldatatable Pin
arkiboys25-Mar-08 5:12
arkiboys25-Mar-08 5:12 
GeneralRe: datatable Pin
Xmen Real 25-Mar-08 5:34
professional Xmen Real 25-Mar-08 5:34 
GeneralRe: datatable [modified] Pin
arkiboys25-Mar-08 5:46
arkiboys25-Mar-08 5:46 
GeneralListView Single Range Selection Pin
Echilon25-Mar-08 4:27
Echilon25-Mar-08 4:27 
GeneralRe: ListView Single Range Selection Pin
Xmen Real 25-Mar-08 5:36
professional Xmen Real 25-Mar-08 5:36 
QuestionHow can i found which process access my file? Pin
Ambarish Jana25-Mar-08 3:58
Ambarish Jana25-Mar-08 3:58 
AnswerRe: How can i found which process access my file? Pin
Rob Philpott25-Mar-08 5:10
Rob Philpott25-Mar-08 5:10 
GeneralRe: How can i found which process access my file? Pin
Giorgi Dalakishvili25-Mar-08 7:53
mentorGiorgi Dalakishvili25-Mar-08 7:53 
Generalcopy listbox items Pin
NewToAspDotNet25-Mar-08 3:41
NewToAspDotNet25-Mar-08 3:41 
GeneralRe: copy listbox items Pin
Gareth H25-Mar-08 4:16
Gareth H25-Mar-08 4:16 
GeneralRe: copy listbox items Pin
partialdata18-Aug-09 17:31
partialdata18-Aug-09 17:31 
Generalenum problem in C# Pin
salon25-Mar-08 3:13
salon25-Mar-08 3:13 
GeneralRe: enum problem in C# Pin
Russell Jones25-Mar-08 3:48
Russell Jones25-Mar-08 3:48 
GeneralRe: enum problem in C# Pin
Gareth H25-Mar-08 3:59
Gareth H25-Mar-08 3:59 
GeneralRe: enum problem in C# Pin
PIEBALDconsult25-Mar-08 4:48
mvePIEBALDconsult25-Mar-08 4:48 
GeneralRe: enum problem in C# Pin
Gareth H25-Mar-08 4:54
Gareth H25-Mar-08 4:54 

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.