www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/05/18:02:07

Message-Id: <199811052301.XAA05937@remus.clara.net>
From: "Arthur" <arfa AT clara DOT net>
To: <djgpp AT delorie DOT com>
Subject: RE: How do I detect a RLE-sprite on a bitmap?
Date: Thu, 5 Nov 1998 23:01:38 -0000
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
In-Reply-To: <Z2m02.203$Es1.165782@nntpserver.swip.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

> 1. How do I detect (i.e. where it is on the bitmap) a RLE-sprite on a
> bitmap? (getpixel() don't work...)
>
> (2. How do I detect a regular sprite on a bitmap?)
> (3. How do I detect a little bitmap on a bitmap?)

Sorry, what are you trying to do? If you want to know where an RLE sprite is
on a bitmap, wouldn't you know already as you've just placed it there?

If you're thinking of comparing two images to find an area of one image
which is the same as the other image, don't use RLE sprites unless you want
to make your job 20 times more complex. A very much simplified algortihm
could be:

1. Use getpixel on the larger bitmap scanning across until you find a pixel
the same colour as the top-left pixel of the sprite.

2. Check the next pixels on the line in turn. Compare these to the sprite
image. If you find a pixel out of place return to step one.

You've got to repeat this many times.

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019