お知らせ

電子会議

ライブラリ

パレット

Delphi FAQ検索

Delphi FAQ一覧

サンプル蔵





FDelphi FAQ
16番会議室「玉石混淆みんなで作るSample蔵」に寄せられたサンプル

"RE:ListBoxにBitMapを貼る(OwnerDraw)"

この発言は
#00106 凛 さんのListBoxにBitMapを貼る(OwnerDraw)
に対するコメントです

この発言に対し以下のコメントが寄せられています
#00124 凛 さん RE^2:ListBoxにBitMapを貼る(OwnerDraw)

凛 さん、こんにちは。凹凹凹です。 ここでレスを付けるのはちょっとあつかましいかもしれませんが、一言。 >procedure TForm1.ListBox1Click(Sender: TObject); >begin > ListBox1.Refresh; >end; このRefreshの変わりに下のように一行追加するとよいでしょう。 procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var theBitMap:TBitMap; DestRect, SourceRect:TRect; begin theBitMap:=TBitmap(ListBox1.Items.Objects[Index]); with SourceRect do begin Top:=0;Left:=0;Right:=theBitmap.Width;Bottom:=theBitmap.Height; end; with DestRect do begin Top:=Rect.Top;Left:=0;Right:=theBitmap.Width; Bottom:=Top+theBitmap.Height; end; ListBox1.Canvas.FillRect(Rect); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ListBox1.Canvas.CopyRect(DestRect,theBitMap.Canvas,SourceRect); ListBox1.Canvas.TextOut( DestRect.Right+2,Rect.Top+2,ListBox1.items[Index] ); end; 97/10/28(火) 03:22 凹凹凹(EZQ01045) Original document by 凹凹凹 氏 ID:(EZQ01045)



ここにあるドキュメントは NIFTY SERVEの Delphi Users' Forum の16番会議室「玉石混淆みんなで作るSample蔵」に投稿されたサンプルです。これらのサンプルはボーランド株式会社がサポートする公式のものではありません。また、必ずしも動作が検証されているものではありません。これらのサンプルを使用したことに起因するいかなる損害も投稿者、およびフォーラムスタッフはその責めを負いません。使用者のリスクの範疇でご使用下さい。

Copyright 1996-2002 Delphi Users' Forum