User Tools

Site Tools


en:getslice

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:getslice [2016/08/12 12:36]
admin
en:getslice [2020/02/28 10:46] (current)
Line 1: Line 1:
 ===== GetSlice (Function) ===== ===== GetSlice (Function) =====
 ==== Format ==== ==== Format ====
-getslice([[numericexpressions|x_position]], [[numericexpressions|y_position]], //width_expr////height_expr//)+getslice([[numericexpressions|x_position]], [[numericexpressions|y_position]], [[numericexpressions|width]][[numericexpressions|height]])
  
-returns //string_value//+returns [[lists|List of Values]]
  
 ==== Description ==== ==== Description ====
-Return a string that contains a Hexadecimal (base 16) representation of the rectangle defined by the parameters.  String is formatted as first 4 bytes - width, next 4 bytes - height, 6 bytes for each pixel (width * height).+Return a 2 dimensional array of the pixels in the rectangle defined by the parameters. 
  
 ==== Example ==== ==== Example ====
 <code> <code>
-color 16-1+clg 
 +color red
 plot 1,1 plot 1,1
-color 16^2-1+color green
 plot 1,2 plot 1,2
-color 16^3-1+color blue
 plot 2,1 plot 2,1
-color 16^4-1+color yellow
 plot 2,2 plot 2,2
-print getslice(1, 1, 2, 2)+ 
 +vals = getslice(1, 1, 2, 3) 
 + 
 +for rows = 0 to 2 
 +  for cols = 0 to 1 
 +    print "("+rows+","+cols+")="+vals[rows,cols] 
 +  next cols 
 +next rows 
 </code> </code>
 displays displays
 <code> <code>
-0002000200000f000fff0000ff00ffff+(0,0)=-65536 
 +(0,1)=-16776961 
 +(1,0)=-16711936 
 +(1,1)=-256 
 +(2,0)=0 
 +(2,1)=0
 </code> </code>
  
Line 30: Line 44:
 ==== New To Version ====  ==== New To Version ==== 
 0.9.6b 0.9.6b
 +
 +==== History ==== 
 +|0.9.6b|New To Version|
 +|1.99.99.65|Changed return value to a 2 dimensional array of pixel values|
  
en/getslice.1471026963.txt.gz · Last modified: 2020/02/28 10:46 (external edit)