Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
TextRenderer.DrawText()宛先の長方形が小さすぎる場合、テキストの終わりを描画できますか?
TextRenderer.DrawText()
TextFormatFlags.Bottom私を助けませんでした。
TextFormatFlags.Bottom
言い換えれば、テキストをその上端でクリップする方法は?
「オーバーフロー領域」のサイズであるメモリ内ビットマップを作成します。-Y座標を使用して、このオーバーフロー領域にテキスト文字列を描画します。これにより、クリップ先の領域と一致する画像の上部が描画されます。これで、画像にオーバーフローテキストが表示され、必要な場所にペイントできます。
たとえば、75ピクセルしか表示できない領域に、高さ100ピクセルのテキストを描画する場合は、高さ25ピクセルの画像を作成し、y=-75でその画像にテキストを描画します。