|
Pages: [1]
|
 |
|
Author
|
Topic: Modifying an image (Read 441 times)
|
|
Kulero
|
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
|
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... 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]
|
|
|
 |