- PR -

C# アルファ透過が指定されている画像をビットマップに書くと汚くなる。

投稿者投稿内容
有末 清華
ベテラン
会議室デビュー日: 2006/10/09
投稿数: 52
お住まい・勤務地: 北海道
投稿日時: 2007-02-03 11:15
ちなみにStopwatchで図った結果Renderを使うと100000くらいでBitmapだと80000でした。
Renderを使う場合実質二回行わなきゃいけないのでトータル200000位、Bitmapだと80000ですむというわけです。
_________________
有末 清華
crazy(){for;;{you();}} - プログラマの覚書
渋木宏明(ひどり)
ぬし
会議室デビュー日: 2004/01/14
投稿数: 1155
お住まい・勤務地: 東京
投稿日時: 2007-02-03 13:01
引用:

有末 清華さんの書き込み (2007-02-03 11:15) より:
ちなみにStopwatchで図った結果Renderを使うと100000くらいでBitmapだと80000でした。
Renderを使う場合実質二回行わなきゃいけないのでトータル200000位、Bitmapだと80000ですむというわけです。



80000ns でも使用感的に大丈夫なんですか?

有末 清華
ベテラン
会議室デビュー日: 2006/10/09
投稿数: 52
お住まい・勤務地: 北海道
投稿日時: 2007-02-03 13:50
できればもう少し早くしたいんですがねぇ…これ以上早くする方法が思いつかないんで妥協してます。

前回作ったやつとほとんど変わらないことしてるはずなんですが構造が複雑になった分遅くなってしまってorz

# ちなみに数値はただのTickなんでナノ秒じゃないです、すいません書き忘れてました。

# ちゃんと計測した結果です。
コード:

// Bitmap
Watch: 18609021ns: Refresh.DrawOnSurface
Watch: 9039600ns: Refresh.SetRegion
Watch: 8284905ns: Refresh.FlipSurface
Watch: 48598731ns: OnMouseMove.Refresh

Watch: 18621018ns: Refresh.DrawOnSurface
Watch: 9629127ns: Refresh.SetRegion
Watch: 8057241ns: Refresh.FlipSurface
Watch: 53689086ns: OnMouseMove.Refresh

Watch: 18158715ns: Refresh.DrawOnSurface
Watch: 9199467ns: Refresh.SetRegion
Watch: 11703213ns: Refresh.FlipSurface
Watch: 54775233ns: OnMouseMove.Refresh

// Buffered
Watch: 15960753ns: Refresh.DrawOnSurface
Watch: 6562917ns: SetRegion.DrawToBitmap
Watch: 30048300ns: Refresh.SetRegion
Watch: 7703190ns: Refresh.FlipSurface
Watch: 71553456ns: OnMouseMove.Refresh

Watch: 44514450ns: Refresh.DrawOnSurface
Watch: 13817196ns: SetRegion.DrawToBitmap
Watch: 47367783ns: Refresh.SetRegion
Watch: 7164162ns: Refresh.FlipSurface
Watch: 122997150ns: OnMouseMove.Refresh

Watch: 34220745ns: Refresh.DrawOnSurface
Watch: 21929400ns: SetRegion.DrawToBitmap
Watch: 50811480ns: Refresh.SetRegion
Watch: 7589637ns: Refresh.FlipSurface
Watch: 114274215ns: OnMouseMove.Refresh

// Buffered (DrawToBitmapにRender(grfx)を使用した高速化したバージョン
Watch: 14955237ns: Refresh.DrawOnSurface
Watch: 2106729ns: SetRegion.DrawToBitmap
Watch: 16765389ns: Refresh.SetRegion
Watch: 3609981ns: Refresh.FlipSurface
Watch: 50739777ns: OnMouseMove.Refresh

Watch: 32000463ns: Refresh.DrawOnSurface
Watch: 3929994ns: SetRegion.DrawToBitmap
Watch: 33527430ns: Refresh.SetRegion
Watch: 9737658ns: Refresh.FlipSurface
Watch: 116527977ns: OnMouseMove.Refresh

Watch: 33423921ns: Refresh.DrawOnSurface
Watch: 3997233ns: SetRegion.DrawToBitmap
Watch: 33837399ns: Refresh.SetRegion
Watch: 6298704ns: Refresh.FlipSurface
Watch: 99118656ns: OnMouseMove.Refresh

Watch: 43456761ns: Refresh.DrawOnSurface
Watch: 4386717ns: SetRegion.DrawToBitmap
Watch: 38474937ns: Refresh.SetRegion
Watch: 4273164ns: Refresh.FlipSurface
Watch: 107478333ns: OnMouseMove.Refresh



って位の差がでてます。(今度はちゃんとナノセコンド)
______________
9uiet design( http://quietdesign.rental.allinoneserver.net/ ) - タブ型デスクトップガジェット開発中。Pluginの開発してくれると嬉しいかも。

[ メッセージ編集済み 編集者: 有末 清華 編集日時 2007-02-03 13:50 ]

[ メッセージ編集済み 編集者: 有末 清華 編集日時 2007-02-03 15:17 ]

[ メッセージ編集済み 編集者: 有末 清華 編集日時 2007-02-03 15:20 ]

スキルアップ/キャリアアップ(JOB@IT)