Results 1 to 4 of 4

Thread: Looking for help to condense this code...

Threaded View

  1. #1

    Thread Starter
    Member mOBSCENE's Avatar
    Join Date
    Mar 2009
    Location
    New Jersey
    Posts
    46

    Looking for help to condense this code...

    I have 4488 lines of SetPixel's because i have a button that i'm making without using a picture. (but this is just for one out of a few pictures)

    I want to condense the lines that are like...

    vb Code:
    1. SetPixel hdc, 0, 0, &HE7EBEE
    2. SetPixel hdc, 1, 0, &HD9DADC
    3. SetPixel hdc, 2, 0, &HCFCFD1
    4. SetPixel hdc, 3, 0, &HCCCCCC
    5. SetPixel hdc, 4, 0, &HCCCCCC
    6. SetPixel hdc, 5, 0, &HCCCCCC
    7. SetPixel hdc, 6, 0, &HCCCCCC
    8. SetPixel hdc, 7, 0, &HCCCCCC
    9. SetPixel hdc, 8, 0, &HCCCCCC
    10. SetPixel hdc, 9, 0, &HCCCCCC
    11. '...and it goes on...
    12. SetPixel hdc, 128, 0, &HCBCBCB
    13. SetPixel hdc, 129, 0, &HCFCFCF
    14. SetPixel hdc, 130, 0, &HD9DADC
    15. SetPixel hdc, 131, 0, &HE6EAEB

    ...and so on. it goes back to other colors at the end, and then new colors start at the next Y coordinate.

    I need the code to make all the lines with the same color like so

    vb Code:
    1. SetPixel hdc, 0, 0, &HE7EBEE
    2. SetPixel hdc, 1, 0, &HD9DADC
    3. SetPixel hdc, 2, 0, &HCFCFD1
    4. DrawLine 3, 0, 127, 0, &HCCCCCC
    5. ' Drawline(X1, Y1, X2, Y2, COLOR)
    6. SetPixel hdc, 128, 0, &HCBCBCB
    7. SetPixel hdc, 129, 0, &HCFCFCF
    8. SetPixel hdc, 130, 0, &HD9DADC
    9. SetPixel hdc, 131, 0, &HE6EAEB

    (this is an example, and i've tried for hours on a way to do it...no methods have worked. i've asked several of my buddies from MSN...theyre stumped as well.

    I'd do it manually if i didnt have so many to do, which is why i need a code maker xD

    Thanks guys
    Last edited by mOBSCENE; Aug 2nd, 2009 at 05:43 PM.

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