The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Graphics.MeasureString: Ma��einheit der R��ckgabe beeinflussen

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
-

Posts: 1524
Nickname: nitronic
Registered: Jul, 2006

Norbert Eder works as a software architect.
Graphics.MeasureString: Ma��einheit der R��ckgabe beeinflussen Posted: Sep 21, 2006 11:12 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by -.
Original Post: Graphics.MeasureString: Ma��einheit der R��ckgabe beeinflussen
Feed Title: Norbert Eder - Living .NET
Feed URL: http://feeds.feedburner.com/NorbertEder-Livingnet
Feed Description: Copyright (c)2005, 2006 by Norbert Eder
Latest .NET Buzz Posts
Latest .NET Buzz Posts by -
Latest Posts From Norbert Eder - Living .NET

Advertisement
Immer wieder taucht die Frage auf, in welcher Einheit die R��ckgabe der Methode MeasureString (Graphics-Object) gehalten ist. Hier die Antwort.

Die Ma��einheit wird ��ber die PageUnit-Eigenschaft des Graphics-Objektes beschrieben. Hierzu wird die Enumeration GraphicsUnit verwendet. Diese besitzt folgende Werte:

- Display
- Document
- Inch
- Millimeter
- Pixel
- Point
- World

Um also die Breite eines Strings in Pixel zu erfahren, ist vor dem Aufruf von MeasureString die Eigenschaft PageUnit des Graphics-Objektes auf GraphicsUnit.Pixel zu stellen.

MSDN: Graphics Class
MSDN: MeasureString Method
MSDN: PageUnit Property

Read: Graphics.MeasureString: Ma��einheit der R��ckgabe beeinflussen

Topic: Pass Variables between Windows Forms Windows without ShowDialog() Previous Topic   Next Topic Topic: Microsoft Faceted Search

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use