Results 1 to 3 of 3

Thread: Drawing lots of images quickly with for statment

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2005
    Posts
    39

    Drawing lots of images quickly with for statment

    Hi,

    The code below draws anywhere from 1 to 75 of these images one after another,
    its basically like with itunes and wmp where you have the lines / green bit on the bit that shows you how much song has played.

    VB Code:
    1. For i As Integer = 4 To CType(((Pos * MyBase.Size.Width) / 100) - 4, Integer) Step 2
    2.     MyBase.CreateGraphics.DrawImage(My.Resources.track_lines, i, 0, My.Resources.track_lines.Width, My.Resources.track_lines.Height)
    3. Next

    I need a better way to do this because at the moment whenever they change they jitter and flash.

    Thanks for your help,

    Cheers,
    Gussy

  2. #2
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    Re: Drawing lots of images quickly with for statment

    Are you drawing directly on the form, or on a control? Whichever it is, you might be better off trying to draw to a bitmap object in memory, then drawing the finished image once.

    Bill
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

  3. #3
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: Drawing lots of images quickly with for statment

    a.k.a. draw all to backbuffer, draw backbuffer to screen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width