Results 1 to 1 of 1

Thread: VB - Anti-Alias Unit

Threaded View

  1. #1

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Post VB - Anti-Alias Unit

    Here's an anti-alias module I wrote some time ago.

    For those who don't know what anti-alias is:
    When drawing pixels on a point that's between 2 pixels
    on the screen, this module will simulate that the pixel is
    drawn between those pixels.
    This is good when making low/mid-res gfx


    It's included in a testprogram that draws some shapes
    to see the difference with AA on.


    To use this in your own program you need GetDIBBits.bas
    and mAntiAlias.bas from the zip and use this code to
    draw:

    VB Code:
    1. PicBox.Cls
    2.     InitSetDIBPixel PicBox.hDC, PicBox.Image.Handle
    3.     DrawAntiAliasPixel X, Y, Red, Green, Blue
    4.     FinishSetDIBPixel PicBox.hDC, PicBox.Image.Handle
    5.     PicBox.Refresh

    Make sure that X and Y are defined as Single or Double
    or else the pixels will not need AA-ing.


    Try it and tell me what you think!
    Attached Files Attached Files
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

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