Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Modifying an image
Pages: [1] Print
Author Topic: Modifying an image  (Read 491 times)
Kulero
Newbie
*
Offline Offline

Posts: 1


View Profile
Modifying an image
« on: March 08, 2005, 06:45:36 PM »

I know how to build an image using layout [effects [draw [...]], but I later need to modify that image.

The only way I can figure how to do this (and it took a whole day to discover it) is to convert the resulting face to an image and rebuild it in another face using ... draw compose [image 0x0 (to-image saved-face) ...]  Performance is bad. Is there some way I'm missing?

I know View 1.3 is supposed to have a draw function, but that's not out yet. I'm longing for it.
Logged
CarlRead
Full Member
***
Offline Offline

Posts: 105


View Profile
Modifying an image
« Reply #1 on: March 08, 2005, 10:26:17 PM »

The draw dialect is the only easy(ish) way to draw with REBOL ATM.  Note you can insert commands into the dialect's block after it's been created, and of course remove them, and a SHOW will update the face, but it's hardly what you'd call an intuitive way of doing things.

You can also poke colors directly to an image.  ie...
Code:
poke pic 1 255.0.0
will set the first pixel in the image (pic) to red.  So a simple function could be created to plot x y points in an image.  (image/size returns the size of an image.)  And that could be used to add more complex drawing functions, (lines and so on), but whether the trouble's worth it would depend on what you're doing.
Logged

- Carl Read
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Modifying an image
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 20, 2008, 11:47:45 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2287 Posts in 593 Topics by 3732 Members
Latest Member: Hentai40

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc