realbasic-nug
[Top] [All Lists]

Image differences, pic1, pic2 = pic 3

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Image differences, pic1, pic2 = pic 3
From: Jules <rb dot shareware at gmail dot com>
Date: Fri, 30 Sep 2005 09:08:04 +0100
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=NozzzXaaACUSwHFpyguoZMmkwdG5CQM+agVkuX888kJk5NM4vFe/MDL6PWnAIOTtIGgVHRVvMwbGrg08XnjZbKm5FGNjOaMrfxRa+0ARkKr87ZEr3kRT2sqcRk/mQT5u096cmTJWw71qezC9zZ2b8LFDdrfSGzXApqhESmRYuhk=
Hi,


Any ideas how I can speed up my image comparison code ?
e.g. not using pixel(x,) ?
I need diferences image.

Heres my code...

Window1.Canvas1.Paint:

g.TextFont = "Arial"
g.TextSize = 300
g.DrawString "A",10,260

Window1.Canvas2.Paint:

g.TextFont = "Arial"
g.TextSize = 300
g.DrawString "B",150,260
g.DrawString "A",10,260

Window1.btnCompare.Action:


dim c1 as graphics = canvas1.graphics
dim c2 as graphics = canvas2.graphics
dim x as double
dim y as double

'dim pic as picture
'pic = newpicture(c1.height,c1.width,32)

for y = 0 to c1.height
for x = 0 to c1.width
if c1.pixel(x,y) <> c2.pixel(x,y) then
'pic.graphics.pixel(x,y) = c2.pixel(x,y)
canvas3.graphics.pixel(x,y) = c2.pixel(x,y)
end if
next x
next y

'canvas3.graphics.drawpicture pic,0,0
canvas3.graphics.drawRect 0,0, canvas3.graphics.width,
canvas3.graphics.height

End Sub

I've seen the "Component X Graphics, CXG_Difference" but it makes the
difference image red
I've also see a PictToString function which uses MacPictColumn, but that
doesn't work for me, posible because of my RB 5.5 standard license.

Thanks.

Jules.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>