@@ -350,37 +350,6 @@ public SolidBrush CreateSolidBrush(Color color)
350350 return new SolidBrush ( _device , color ) ;
351351 }
352352
353- /// <summary>
354- /// Specifies a rectangle to which all subsequent drawing operations are clipped.
355- /// </summary>
356- /// <param name="left">The x-coordinate of the upper-left corner of the rectangle.</param>
357- /// <param name="top">The y-coordinate of the upper-left corner of the rectangle.</param>
358- /// <param name="right">The x-coordinate of the lower-right corner of the rectangle.</param>
359- /// <param name="bottom">The y-coordinate of the lower-right corner of the rectangle.</param>
360- public void ClipRegionStart ( float left , float top , float right , float bottom )
361- {
362- if ( ! IsDrawing ) ThrowHelper . UseBeginScene ( ) ;
363-
364- _device . PushAxisAlignedClip ( new RawRectangleF ( left , top , right , bottom ) , PerPrimitiveAntiAliasing ? AntialiasMode . PerPrimitive : AntialiasMode . Aliased ) ;
365- }
366-
367- /// <summary>
368- /// Specifies a rectangle to which all subsequent drawing operations are clipped.
369- /// </summary>
370- /// <param name="region">A Rectangle representing the size and position of the clipping area.</param>
371- public void ClipRegionStart ( Rectangle region )
372- => ClipRegionStart ( region . Left , region . Top , region . Right , region . Bottom ) ;
373-
374- /// <summary>
375- /// Removes the last clip from the render target. After this method is called, the clip is no longer applied to subsequent drawing operations.
376- /// </summary>
377- public void ClipRegionEnd ( )
378- {
379- if ( ! IsDrawing ) ThrowHelper . UseBeginScene ( ) ;
380-
381- _device . PopAxisAlignedClip ( ) ;
382- }
383-
384353 /// <summary>
385354 /// Draws a circle with a dashed line by using the given brush and dimension.
386355 /// </summary>
@@ -1255,43 +1224,6 @@ public void DrawTextWithBackground(Font font, float fontSize, IBrush brush, IBru
12551224 layout . Dispose ( ) ;
12561225 }
12571226
1258- /// <summary>
1259- /// Measures the specified string when drawn with the specified Font.
1260- /// </summary>
1261- /// <param name="font">Font that defines the text format of the string.</param>
1262- /// <param name="fontSize">The size of the Font. (does not need to be the same as in Font.FontSize)</param>
1263- /// <param name="text">String to measure.</param>
1264- /// <returns>This method returns a Point containing the width (x) and height (y) of the given text.</returns>
1265- public Point MeasureString ( Font font , float fontSize , string text )
1266- {
1267- if ( ! IsDrawing ) throw ThrowHelper . UseBeginScene ( ) ;
1268-
1269- if ( text == null ) throw new ArgumentNullException ( nameof ( text ) ) ;
1270- if ( text . Length == 0 ) return default ;
1271-
1272- var layout = new TextLayout ( _fontFactory , text , font . TextFormat , Width , Height ) ;
1273-
1274- if ( fontSize != font . FontSize )
1275- {
1276- layout . SetFontSize ( fontSize , new TextRange ( 0 , text . Length ) ) ;
1277- }
1278-
1279- var result = new Point ( layout . Metrics . Width , layout . Metrics . Height ) ;
1280-
1281- layout . Dispose ( ) ;
1282-
1283- return result ;
1284- }
1285-
1286- /// <summary>
1287- /// Measures the specified string when drawn with the specified Font.
1288- /// </summary>
1289- /// <param name="font">Font that defines the text format of the string.</param>
1290- /// <param name="text">String to measure.</param>
1291- /// <returns>This method returns a Point containing the width (x) and height (y) of the given text.</returns>
1292- public Point MeasureString ( Font font , string text )
1293- => MeasureString ( font , font . FontSize , text ) ;
1294-
12951227 /// <summary>
12961228 /// Draws a string with a background box in behind using the given font, size and position.
12971229 /// </summary>
0 commit comments