Results 1 to 3 of 3

Thread: Fast fullscreen setpixel...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Israel
    Posts
    636

    Fast fullscreen setpixel...

    Hi!

    When I run this code:

    dim DC as long
    DC = LoadDC("C:\1.bmp")

    for Y = 0 to 600
    for X = 0 to 800
    setpixel form1.hdc, X, Y, getpixel(DC,X,Y)
    next X
    next Y


    It runs slowly, like a powerpoint switching pictures.
    why?

    Thank you,
    Arie. (mag.up.co.il)

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    It's because Setpixel and Getpixel are two very slooooow operations.
    See the thread about getting pixels of a large area really quickly. Suggested is a pointer method to make it go fast. Although an 800x600 picture still takes about 1.5 seconds.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Lookup bitblt in msdn
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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