Purpose of Clip member in Graphics
-
Hello I was trying to use a Clip to define the drawing area on a graphic Let says that I'm woking with a Graphics on a page : bound 0,0,1200,1800 I define a clip at 100,100,700,900 So the clipBound is 100,100,700,900 I was expecting that if I draw something at 0,0 on that graphics it will be 0,0 on my clip so 100,100 on my page But it remain 0,0 on the page So my question is : What is the use of a clip ? Is it really usefull for some purpose ? Thank for your help
-
Hello I was trying to use a Clip to define the drawing area on a graphic Let says that I'm woking with a Graphics on a page : bound 0,0,1200,1800 I define a clip at 100,100,700,900 So the clipBound is 100,100,700,900 I was expecting that if I draw something at 0,0 on that graphics it will be 0,0 on my clip so 100,100 on my page But it remain 0,0 on the page So my question is : What is the use of a clip ? Is it really usefull for some purpose ? Thank for your help
Ummm, according to the documentation a Clip "gets or sets a Region that limits the drawing region of this Graphics." Why would you think it translates coordinates?
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
Ummm, according to the documentation a Clip "gets or sets a Region that limits the drawing region of this Graphics." Why would you think it translates coordinates?
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
Thanks for you reply Walt "gets or sets a Region that limits the drawing region of this Graphics." Let's assume that So how that limit works ? If I set a clip as Graphics.Clip(new Region(new Rectangle(100,100,500,800)); The limited region will be 100,100,500,800 So at least if the coordinates are not translated, drawing at 0, 0 is outside the clip and I will see nothing But is seems that I can continue to draw anywhere on the original graphics
-
Thanks for you reply Walt "gets or sets a Region that limits the drawing region of this Graphics." Let's assume that So how that limit works ? If I set a clip as Graphics.Clip(new Region(new Rectangle(100,100,500,800)); The limited region will be 100,100,500,800 So at least if the coordinates are not translated, drawing at 0, 0 is outside the clip and I will see nothing But is seems that I can continue to draw anywhere on the original graphics
-
You are supposed to be able to use any valid coordinate, but only the ones inside the clip bounds would be drawn on the graphic surface.
Opacity, the new Transparency.
You are supposed to be able to use any valid coordinate, but only the ones inside the clip bounds would be drawn on the graphic surface. That was not the result I got I will try again... Maybe the fact that I was using a TransFormMatrix on the Graphics affects the normal behaviour
-
Thanks for you reply Walt "gets or sets a Region that limits the drawing region of this Graphics." Let's assume that So how that limit works ? If I set a clip as Graphics.Clip(new Region(new Rectangle(100,100,500,800)); The limited region will be 100,100,500,800 So at least if the coordinates are not translated, drawing at 0, 0 is outside the clip and I will see nothing But is seems that I can continue to draw anywhere on the original graphics
Take a look at the example at http://msdn.microsoft.com/en-us/library/system.drawing.graphics.resetclip.aspx[^] As you mentioned in another post, perhaps the transformation is affecting the way it appears to work.
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
Take a look at the example at http://msdn.microsoft.com/en-us/library/system.drawing.graphics.resetclip.aspx[^] As you mentioned in another post, perhaps the transformation is affecting the way it appears to work.
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software