Results 1 to 6 of 6

Thread: writing and reading a line of picture points

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    1

    writing and reading a line of picture points

    I have a program that reads a bmp picture file
    manipulates it and writes it back out to the screen
    I am using point and pset, which is very slow

    I wrote a faster version that uses picture.line to write
    (if the color is the same for consecutive points)
    otherwise it uses pset

    There must be a way to do a SINGLE operation to
    read and write multiple picture points into an long array
    i.e. a full line of points

    I would think this would speed things up concerably

    anybody have something that does this
    Bitblt may do this with all the "proper setup"
    Last edited by shaversm; Aug 20th, 2002 at 03:31 PM.
    smshaver

  2. #2
    Junior Member
    Join Date
    Aug 2002
    Location
    Phoenix
    Posts
    30

    There is probly a faster way, however,

    Instead of pSet, use SetPixelV instead. It's much faster itself and will speed up the routine.
    (also included getPixel)
    '===================================================================
    'SetPixel function used to set a pixel on an hDC.
    '-------------------------------------------------------------------
    Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, _
    ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
    '===================================================================
    'GetPixel gets a pixel from hDC, generaly used for effects in this class
    '-------------------------------------------------------------------
    Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, _
    ByVal X As Long, ByVal Y As Long) As Long


    'example, pixel plotting on the form:
    SetPixel Me.hdc, 100, 100, RGB(255, 0, 0)

    would set a pixel on the form at x = 100, y = 100, with red color.
    simple and fast

    Hope that helps.
    I'm in college now.

  3. #3
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    which is faster/better setpixel or setpixelV currently i use setpixel
    (what happened to setpixelII-IV

  4. #4
    New Member
    Join Date
    Aug 2002
    Posts
    8
    why not just use bitblt to get areas of the picture you want it?

    i find it faster then get/set pixel

  5. #5
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Because, when using BitBlt, you can't manipulate the pixels... the fastest method, however, would be to copy the picture into a Ayte array, manipulate, and copy it back.

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    SetPixelV stands for SetPixel that doesn't return the Value.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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