DrawTextInRect Method (String, Int32, Int32, Int32, Int32, Int32, Int32, UInt32, Color, Font)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Draws text in a specified rectangle.
Namespace: Microsoft.SPOT
Assembly: Microsoft.SPOT.Graphics (in Microsoft.SPOT.Graphics.dll)
Syntax
'Declaration
Public Function DrawTextInRect ( _
ByRef text As String, _
ByRef xRelStart As Integer, _
ByRef yRelStart As Integer, _
x As Integer, _
y As Integer, _
width As Integer, _
height As Integer, _
dtFlags As UInteger, _
color As Color, _
font As Font _
) As Boolean
public bool DrawTextInRect(
ref string text,
ref int xRelStart,
ref int yRelStart,
int x,
int y,
int width,
int height,
uint dtFlags,
Color color,
Font font
)
public:
bool DrawTextInRect(
String^% text,
int% xRelStart,
int% yRelStart,
int x,
int y,
int width,
int height,
unsigned int dtFlags,
Color color,
Font^ font
)
member DrawTextInRect :
text:string byref *
xRelStart:int byref *
yRelStart:int byref *
x:int *
y:int *
width:int *
height:int *
dtFlags:uint32 *
color:Color *
font:Font -> bool
public function DrawTextInRect(
text : String,
xRelStart : int,
yRelStart : int,
x : int,
y : int,
width : int,
height : int,
dtFlags : uint,
color : Color,
font : Font
) : boolean
Parameters
- text
Type: System. . :: . .String%
The text to be drawn. This parameter contains the remaining text, or an empty string, if the complete text string did not fit in the specified rectangle.
- xRelStart
Type: System. . :: . .Int32%
The x-coordinate, relative to the rectangle, at which text drawing is to begin.
- yRelStart
Type: System. . :: . .Int32%
The y-coordinate, relative to the rectangle, at which text drawing is to begin.
- x
Type: System. . :: . .Int32
The x-coordinate of the upper-left corner of the rectangle.
- y
Type: System. . :: . .Int32
The y-coordinate of the upper-left corner of the rectangle.
- width
Type: System. . :: . .Int32
The width of the rectangle.
- height
Type: System. . :: . .Int32
The height of the rectangle.
- dtFlags
Type: System. . :: . .UInt32
Flags that specify the format of the text.
- color
Type: Microsoft.SPOT.Presentation.Media. . :: . .Color
The color to be used for the text.
- font
Type: Microsoft.SPOT. . :: . .Font
The font to be used for the text.
Return Value
Type: System. . :: . .Boolean
true if all of the specified text was drawn; false if this is not the case and the text parameter contains the remaining text that was not drawn.
Remarks
If a bitmap is embedded as a resource, and its BitmapImageType is Bmp, then the Bitmap object is read-only, and attempts to modify it will throw an exception. You must make a copy of it using Bitmap.DrawImage, and modify the copy, as shown in the following code:
Bitmap bmpMyBitmap = Resources.GetBitmap(Resources.BitmapResources.MyBitmap);
Bitmap bmpCopy = new Bitmap(bmpMyBitmap.Width, bmpMyBitmap.Height);
// copy the bitmap
bmpCopy.DrawImage(0, 0, bmpMyBitmap, 0, 0, bmpMyBitmap.Width, bmpMyBitmap.Height);
// now you may modify the copy using any Bitmap method
bmpCopy.MakeTransparent(Microsoft.SPOT.Presentation.Media.Color.White);
The .NET Micro Framework provides the Microsoft.SPOT.Bitmap class for lower-level access, such as animation. For displaying static bitmaps and hyperlinked bitmaps, use the Image control.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.