Gradient Textures

Richard Gaskin ambassador at fourthworld.com
Wed Aug 29 13:46:10 EDT 2007


David Bovill wrote:

 > Richard, when you say:
 >> using a stretched image as a backgroundPattern causes the
 >> object using it to render with varied tiling results
 >
 > Do you mean that if I use backgroundpattern with a button or
 > group then the text label or other elements that you would
 > expect to work can work inconsistently - or are you refering
 > to the effect you would expect if the gradient bitmap has
 > bitmap text burn

On that sentence I was referring to the former, but both have anomalies, 
each of a different sort.

If you have what is really a small image (8 pixels wide) stretched 
horizontally to, say, 800 px, then the imageData is really only 8 pixels 
regardless of how the image object is sized.  So when you assign the ID 
of that image object to another object, such as a button, it will adopt 
the imageData when rendered, regardless of the apparent size of that 
image object.

In most cases that may be fine, but in v2.6.2 an earlier (haven't 
experimented since the compositing engine was revamped) the OS limits on 
tiled images could sometimes give unexpected results.

For example, if you make a vertical gradient using the "narrow" method I 
decribe, and make that image object 1024x768 (I use this mostly for 
presentation backgrounds), then you can place the object in a background 
and it works great.  But if instead you set the backgroundPattern of the 
card or stack to use that image, on Mac it'll crop the height to some 
arbitrary limit I haven't taken the time to define, causing it to tile 
vertically as well as horizontally, causing the gradient to appear 
truncated and start over again from the top somewhere in the middle of 
the card.

With the other situation (burning text into an image), the visual 
distortion is merely what one would expect when stretching the image object.

-- 
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list