Results 1 to 7 of 7

Thread: Get/SetPixel

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    33

    Unhappy

    I am working on a program to do lightsaber effects. The algorithm can print it on a black background. I can add the color values using Get/SetPixel, but it does some weird things. Download the file here. You will need to right click and choose save file as. Just open it, click on a color button, and click the Get/Set Pixel button. Then click Ok! in the new window. You can see what I mean. Anyone know how to fix it? I know this program is disorganized. It is a test, so I can get the core to work before I implement most of the features.

  2. #2

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    33
    no one knows?

  3. #3
    Addicted Member bbosh's Avatar
    Join Date
    Oct 2000
    Location
    Hell (AKA New Mexico)
    Posts
    186
    I havent checked your source but are you weighting the colors? EG,
    Code:
    DispPixelColor = (BGColor * 0.2)+(FGColor * 0.8)
    Otherwise, you'll get some funny results
    Brian
    Programming: VB5 Pro (SP3) - QBasic 1.1,4.5
    Internet: HTML 4, CSS, JavaScript
    Visit AltInt.com!

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    33
    I'm not. It averages the colors:
    disp=(color1+color2)/2

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    33
    Wait! Id adds the colors, as the saber is rendered on a clack background. However, assuming res is the result pixel color, I do have:
    Code:
    if res>RGB(255, 255, 255) then res=RGB(255,255,255)
    So it should work.

  6. #6
    Addicted Member bbosh's Avatar
    Join Date
    Oct 2000
    Location
    Hell (AKA New Mexico)
    Posts
    186
    It should work then. Maybe you don't have enough colors available on your local system?
    Brian
    Programming: VB5 Pro (SP3) - QBasic 1.1,4.5
    Internet: HTML 4, CSS, JavaScript
    Visit AltInt.com!

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    33
    32 bit 1152x864.

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