realbasic-nug
[Top] [All Lists]

Re: Reversing an image

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Reversing an image
From: John Kubie <jkubie at mac dot com>
Date: Thu, 29 Dec 2005 19:49:32 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20051229211240 dot 1D004F9B1C5 at lists dot realsoftware dot com> <9C81CE50-5DDE-41B1-B98F-F956A66D0F5E at farhner dot com>
This more a question than a suggestion.

If you use drawpicture, you can scale one picture as it's drawn onto another.

Perhaps, if you inverted the source range (x1>x1 or y1>y2) you would get an inverted image?

Drawpicture shoould be much faster than going thru pixel-by-pixel.

Does this work?

John Kubie


On Dec 29, 2005, at 6:58 PM, Ben Farhner wrote:

Hi,

Okay, I have a thread that reverses an image. Heres the code:

  for i=0 to p.width-1
    for j=0 to p.height-1
      c=r1.pixel(i,j)
      r2.pixel(i,j)=rgb(255-c.red,255-c.green,255-c.blue)
      progress.prog.value=progress.prog.value+1
    next
    progress.prog.value=progress.prog.value+1
  next

The problem is, that takes over 8 seconds. Other programs, such as Seashore, do it instantly. I'm using RGBSurfaces, which is supposed to be faster, but is there a faster way? I'm on RB 5.2.4, Mac OS X 10.4.3. Thanks,


Ben Farhner
CEO / Head Developer
farhnware
http://macware.byethost5.com


_______________________________________________
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>

_______________________________________________
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>