Advertisement

Colorkeying not working properly

Started by July 31, 2000 08:01 AM
2 comments, last by epic709 24 years, 4 months ago
I don''t know why this is happening but when I blit a 64x128 bitmap from my offscreen surface to the backbuffer, I get the following result: It gets weirder b''coz when my bitmap was initially 64x64, there was no offending black line. Black (RGB 0,0,0) is my colorkey btw. I even checked in Photoshop to see if I had accidentally left a non-pure black line on the bitmap but there was no such thing. Then I thought maybe I had scaled the image by mistake when blitting but my source rect''s dimensions are same as the destination''s. I''m baffled at this point. Anybody know what could be wrong here? Why is there a black line that shows on screen when it should have been colorkeyed out? Observing closely, I noticed the line was not continuous - it starts at the top, goes down until it meets the edge of the flowerbed, leaves a few pixels for the flowerbed''s edge, then continues to the bottom. Plain weird.
nice gfx btw .

For some really, REALLY, strange reason with direct x and my machine... If my resolution is 32bits, I''m rendering to a window, my bltted surface is in offscreenplain, the surface has a colorkey, and I have only created surfaces the first time for the application:

I get lines just as you are describing throughout my whole color keyed area (thus not on the flowers) that are the color exactly as my color key. I was getting lines every four pixels on a 32x32 surface. It''s really weird, if I destroy and re-create the surfaces using the exact same functions within the same program thread the lines disappear.

My problem is unexplainable. To get around this, I created all surfaces in systemmemory. btw, for comparison I have an ATI Rage Pro Turbo 2x AGP onboard. Are you using the Win32 API? I think it might have to do with the LoadImage function because I never tried my own loading routines.
___________________________Freeware development:ruinedsoft.com
Advertisement
It might be to do with the way you are bliting to the screen. Are you using d3d to display the flowers or DD?
When I find my code in tons of trouble,Friends and colleages come to me,Speaking words of wisdom:"Write in C."My Web Site
well, I believe I narrowed the weirdness down to an inadequacy in using Photoshop. After zooming in to 1600% and turning on quick mask, I noticed that indeed there were pixels that somehow affect neighbouring pixels when I paint/pencil them in even after turning off anti-alias, spacing, etc.

but these were not the lines I mentioned previously. That was the "black line bug". This I call the "black fringe bug". Look very close at the posted pic and you'll notice a 1-pixel fringe on the right corners of the flowerbed. Tried as I might, there was no way to draw solid independent pixels or the reverse: erase the offending pixels. Even when I magic wand the background these offending pixels apparently do not exist (tolerance set to 0, thank you).

to fix this I converted my 16-bit image to a 8-bit one and believe it not, the fringes disappeared! Hah! guess the offending pixels got thrown out during the conversion.

well, that's my graphical solution to this weird bug but what I
really like to know is if this is caused by code somehow. I didn't bother with my own image loading routines either - just took from the DX7 tutorials.....

and oh, the gfx is done with DDraw btw.

Edited by - epic709 on August 2, 2000 12:12:15 PM

This topic is closed to new replies.

Advertisement