Graphics.DrawImage is slow?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cesar Ronchese

    Graphics.DrawImage is slow?

    Hey!

    I'm printing some stuff in a memory-created bitmap (format
    Imaging.PixelFo rmat.Format16bp pRgb565) 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.PixelFo rmat.Format16bp pRgb565)
    g = Graphics.FromIm age(mBmp)
    (...)
    e.Graphics.Draw Image(mBmp, New Point(0, 0))
    g.Dispose()


  • Herfried K. Wagner [MVP]

    #2
    Re: Graphics.DrawIm age is slow?

    "Cesar Ronchese" <ronchese*smlin fo.com.br> schrieb:[color=blue]
    > I'm printing some stuff in a memory-created bitmap (format
    > Imaging.PixelFo rmat.Format16bp pRgb565) 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.[/color]

    Use 'DrawImageUnsca led' 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/>

    Comment

    • Cesar Ronchese

      #3
      Re: Graphics.DrawIm age is slow?

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



      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:ekw2%239Fw FHA.256@TK2MSFT NGP15.phx.gbl.. .
      "Cesar Ronchese" <ronchese*smlin fo.com.br> schrieb:[color=blue]
      > I'm printing some stuff in a memory-created bitmap (format
      > Imaging.PixelFo rmat.Format16bp pRgb565) 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.[/color]

      Use 'DrawImageUnsca led' 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/>


      Comment

      • Dennis

        #4
        Re: Graphics.DrawIm age is slow?

        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:
        [color=blue]
        > Yeah, I used that too. But that 0.015 seconds still almost the same.
        >
        >
        >
        > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
        > news:ekw2%239Fw FHA.256@TK2MSFT NGP15.phx.gbl.. .
        > "Cesar Ronchese" <ronchese*smlin fo.com.br> schrieb:[color=green]
        > > I'm printing some stuff in a memory-created bitmap (format
        > > Imaging.PixelFo rmat.Format16bp pRgb565) 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.[/color]
        >
        > Use 'DrawImageUnsca led' 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/>
        >
        >
        >[/color]

        Comment

        Working...