Graphics.DrawImage is slow?

C

Cesar Ronchese

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()
 
H

Herfried K. Wagner [MVP]

Cesar Ronchese said:
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.
 
C

Cesar Ronchese

Yeah, I used that too. But that 0.015 seconds still almost the same.



Cesar Ronchese said:
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.
 
G

Guest

If you want speed, you can copy a bitmap image to another bitmap using the
WinAPI bitblt function...it's very quick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top