Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

transparancy

What would one have to do if one wanted thier graphics to be made
transperant useing c++? I have the only graphics program that I can
afford right now. But it doesn't have any way (that I have found) to
make anything transparent. What would you do?

Comments

  • Josh CodeJosh Code Posts: 675Member
    : What would one have to do if one wanted thier graphics to be made
    : transperant useing c++? I have the only graphics program that I can
    : afford right now. But it doesn't have any way (that I have found) to
    : make anything transparent. What would you do?
    :
    :

    Try looking at some of the projects on this page:
    http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?txtCriteria=transparent&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE&lngWId=3&optSort=Alphabetical

    Someone posted in the Graphics programming board about this. His alias is Ams. He might have found some information on it.
  • korkor Posts: 198Member
    : What would one have to do if one wanted thier graphics to be made
    : transperant useing c++? I have the only graphics program that I can
    : afford right now. But it doesn't have any way (that I have found) to
    : make anything transparent. What would you do?
    :
    :

    If I understand what you want correctly, you want to have an image that, when displayed in some program you write, has parts that are transparent.

    Note: I don't know c/c++ well, I prefer assembly, so expect no code.

    Assuming you're using a bitmap of some sort:
    First, pick a color to be transparent, for example, in rrggbb format:
    ffffff
    which happens to be white
    Make a matrix of whatever size you want to display, and place your background image in it, with each element corrisponding to one pixel. Then place your bitmap in the matrix, excluding all pixels of the color you chose with a simple loop, with an if statment like (hope I get this right, I know I said no code, but here's some anyway):
    if (pixel!=ffff)
    {
    place pixel in matrix
    }

    to exclude all pixels of the color you chose.
    Hope this helps.
Sign In or Register to comment.