Thread: removing parts of an image?

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    479

    removing parts of an image?

    (allegro)


    hi

    in my game i have a spaceship,
    enemyships, and a background
    which by the time is black but i will
    make some stars so that it looks like
    the ships is moving.


    the problem i have is how do i remove
    the ugly black parts aroung my ship.bmp so when i move over another image only
    the spaceship parts will show(not the whole black rectangle)

    anyone know how its done or what its called
    thaks, pode

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    8
    There is a real easy way in sdl to do transpearacy so i would think that you could do it in allegro too.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    yeah but how?

  4. #4
    Evil Sock Puppet MadHatter's Avatar
    Join Date
    Nov 2002
    Posts
    176
    if you're using draw_sprite() (and probably others) just make the transparent part of your image that pink colour (i think the RGB is 255, 0, 255).
    If I had a world of my own, everything would be nonsense. Nothing would be what it is, because everything would be what it isn't. And contrariwise, what it is, it wouldn't be, and what it wouldn't be, it would. You see?

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    sorry i did'nt get that,
    what fuction should i use?
    can anyone show me an example on how its done please

  6. #6
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    pode, no offense but a lot of your questions are very simple questions, and you could easily find the answers if you took the time to find them. a good place to go search for these answers is at allegro.cc

    Anways, in your actual image editor load your bmp. The parts in the bmp that you don't want to show up make those parts the RGB color of (255, 0, 255). Basically it's the brightest pink you can possibly get! For the functions you are going to want to use either draw_sprite() or masked_blit().

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Go learn this

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 04:17 AM
  2. Replies: 1
    Last Post: 05-27-2009, 12:46 PM
  3. Removing parts of a string...
    By Junior89 in forum C++ Programming
    Replies: 2
    Last Post: 07-01-2007, 02:10 AM
  4. Replies: 4
    Last Post: 03-02-2003, 09:12 AM
  5. C - Removing Lists or parts
    By perfect12 in forum C Programming
    Replies: 2
    Last Post: 12-10-2001, 04:10 PM