By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

Graphics.DrawImage is slow?

P: n/a
Hey!

I'm printing some stuff in a memory-created bitmap (format
Imaging.PixelFormat.Format16bppRgb565) and, at the end, copying the bitmap
to graphic device of my UserControl.

I noticed that method is not too fast to draw from my memory bitmap. In
medium, is taking 0.015 seconds to execute on a Pentium 2.26 GH, 512 RAM,
Windows 2K, with almost 1024x768 resolution area.

There are some advice concerning speed up it?

Cesar
Ps.: piece of code:

mBmp = New Bitmap(Me.Width, Me.Height,
Imaging.PixelFormat.Format16bppRgb565)
g = Graphics.FromImage(mBmp)
(...)
e.Graphics.DrawImage(mBmp, New Point(0, 0))
g.Dispose()
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Cesar Ronchese" <ronchese*smlinfo.com.br> schrieb:
I'm printing some stuff in a memory-created bitmap (format
Imaging.PixelFormat.Format16bppRgb565) and, at the end, copying the bitmap
to graphic device of my UserControl.

I noticed that method is not too fast to draw from my memory bitmap. In
medium, is taking 0.015 seconds to execute on a Pentium 2.26 GH, 512 RAM,
Windows 2K, with almost 1024x768 resolution area.


Use 'DrawImageUnscaled' if no scaling should be performed.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
Yeah, I used that too. But that 0.015 seconds still almost the same.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ek***************@TK2MSFTNGP15.phx.gbl...
"Cesar Ronchese" <ronchese*smlinfo.com.br> schrieb:
I'm printing some stuff in a memory-created bitmap (format
Imaging.PixelFormat.Format16bppRgb565) and, at the end, copying the bitmap
to graphic device of my UserControl.

I noticed that method is not too fast to draw from my memory bitmap. In
medium, is taking 0.015 seconds to execute on a Pentium 2.26 GH, 512 RAM,
Windows 2K, with almost 1024x768 resolution area.


Use 'DrawImageUnscaled' if no scaling should be performed.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

P: n/a
If you want speed, you can copy a bitmap image to another bitmap using the
WinAPI bitblt function...it's very quick.
--
Dennis in Houston
"Cesar Ronchese" wrote:
Yeah, I used that too. But that 0.015 seconds still almost the same.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ek***************@TK2MSFTNGP15.phx.gbl...
"Cesar Ronchese" <ronchese*smlinfo.com.br> schrieb:
I'm printing some stuff in a memory-created bitmap (format
Imaging.PixelFormat.Format16bppRgb565) and, at the end, copying the bitmap
to graphic device of my UserControl.

I noticed that method is not too fast to draw from my memory bitmap. In
medium, is taking 0.015 seconds to execute on a Pentium 2.26 GH, 512 RAM,
Windows 2K, with almost 1024x768 resolution area.


Use 'DrawImageUnscaled' if no scaling should be performed.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.