AQGridView: no padding on outside, only inside - aqgridview

I have a 768px-wide grid view, with cells that are 240 wide. This means that I get 3 columns, with 8 pixels of padding on the left and right of each. This is similar to this situation: AQGridView: How to adjust UIGridViewCell margin.
Instead of evening out the padding, I want the padding to be only in the "middle", not on the outside of the outer columns.
So:
[ [cell] [24 pixels of padding] [cell] [24 pixels of padding] [cell] ]
Is this possible?

Related

Migradoc - aligning a table vertically

I would like to position my table by controlling its placement both vertically and horizontally.
I can place it horizontally using the following:
Commodtable.Rows.LeftIndent = "5cm"
How do I do the same but vertically? I know there is verticalalignment but there are only 3 options: Top, Middle and bottom.
This is so i can eventually place 6 tables in a 3 x 2 arrangement.
To get the 3 x 2 arrangement you can add tables to a table.
See this post:
https://stackoverflow.com/a/36304148/162529
Do draw a table at an absolute position you can add the table to a TextFrame object.
But to get the 3 x 2 arrangement, I would probably prefer nested tables.

What is the "star" measurement in Expression Blend?

I am currently working on a Windows 8 Metro/Modern UI application. Right now, I'm working on the interface in Expression Blend for Visual Studio.
My question is this: When sizing UI elements such as grid columns, I can use either pixels, auto, or stars. What is a star in this context? A google search turns up nothing and I haven't found anything in the Windiws 8 developer documentation.
Thank you.
In a grid a * means that it will equally share available space with other * columns (or rows). There are some good WPF examples of how this works here.
From the documentation here:
starSizing
A convention by which you can size rows or columns to take
the remaining available space in a Grid. A star sizing always includes
the asterisk character (), and optionally precedes the asterisk with
an integer value that specifies a weighted factor versus other
possible star sizings (for example, 3). For more information about
star sizing, see Grid.
In a grid with multiple columns, the * size columns divide up the remaining space. For example assume a 300px wide grid with 3 columns (150px, 120px and 1*).
The calculation is:
remainder = (300 - 150 - 120)
Since the remainder is 30px the 1* column is 30px wide
Now add some columns and modify the widths to (35px, 85px, 2*, 1*, 3*)
Redoing the calculation:
remainder = (300 - 35 - 85)
In this scenario the remainder is 180px, so each * column splits the remaining pixels according to their weighting number.
factor = (180/ (2 + 1 + 3))
factor = 30px
Therefore the 2* column is 60px, the 1* column is 30px and the 3* column is 90px
300 == 35 + 85 + 60 + 30 + 90
Of course the same principles apply for Row sizing.
When the grid is resized the * columns divvy up the new remainder size. But they keep the same size ratio between other * size items. In the example the 3* column will always be 3 times as wide as the 1* column.

Where is rebol fill-pen documented (to get glow effect on a round rectangle)?

There is some discussion here about fill-pen
http://www.mail-archive.com/rebol-bounce#rebol.com/msg02019.html
But I can't see documentation about cubic, diamond, etc... effect for fill-pen in rebol's official doc ?
I'm trying to draw some round rectangle with glowing effect but don't really understand the parameters I'm playing with so I can't get exactly what I'd like (I'd like the glow effect starting from the center not from the dark left top corner):
view layout [
box 278x185 effect [ ; default box face size is 100x100
draw [
anti-alias on
; information for the next draw element (not required)
line-width 2.5 ; number of pixels in width of the border
pen black ; color of the edge of the next draw element
; fill pen is a little complex:
;fill-pen 10x10 0 90 0 1 1 0.0.0 255.0.0 255.0.255
fill-pen radial 20x20 5 55 5 5 10 0.0.0 55.0.5 55.0.5
; the draw element
box ; another box drawn as an effect
15 ; size of rounding in pixels
0x0 ; upper left corner
278x170 ; lower right corner
]
]
]
Finally I made it so not sure how I did manage to get :)
(source: reboltutorial.com)
view banner: layout/size [
;layout (window client area) size is 278x170 at the end of the spec block
at 0x0 ;put the banner on the top left corner
box 278x170 effect [ ; default box face size is 100x100
draw [
anti-alias on
; information for the next draw element (not required)
line-width 2.5 ; number of pixels in width of the border
pen black ; color of the edge of the next draw element
; fill pen is a little complex:
;fill-pen 10x10 0 90 0 1 1 0.0.0 255.0.0 255.0.255
;fill-pen radial 100x50 5 55 5 5 10 55.0.5 30.10.10 55.0.5
;fill-pen radial 100x50 5 55 5 10 10 55.0.5 30.10.10 71.0.6
fill-pen radial 100x50 5 55 5 10 10 71.0.6 30.10.10 71.0.6
; the draw element
box ; another box drawn as an effect
15 ; size of rounding in pixels
0x0 ; upper left corner
278x170 ; lower right corner
]
]
pad 30x-150
Text "Experiment" font [name: "Impact" size: 24 color: white]
image http://www.rebol.com/graphics/reb-logo.gif
] 278x170

GNUPLOT: dot plot with data depending dot size

I am trying plot data sets consisting of 3 coordinates:
X-coordinate, x-coordinate and the number of occurrences.
example:
1 2 10
3 1 2
3 2 1
I would like to draw for every line a dot at x,y with a diameter which is depending on the third value.
Is that possible with Gnuplot?
Create a 2D plot with variable point size. See the demo.
Example:
plot 'dataFile.dat' u 1:2:3 w points lt 1 pt 10 ps variable
This is basically equivalent to the existing answer, just shorter:
plot 'dataFile.dat' with circles
Credit: Gnuplot: plot with circles of a defined radius

How to Resize using Lanczos

I can easily calculate the values for sinc(x) curve used in Lanczos, and I have read the previous explanations about Lanczos resize, but being new to this area I do not understand how to actually apply them.
To resample with lanczos imagine you
overlay the output and input over
eachother, with points signifying
where the pixel locations are. For
each output pixel location you take a
box +- 3 output pixels from that
point. For every input pixel that lies
in that box, calculate the value of
the lanczos function at that location
with the distance from the output
location in output pixel coordinates
as the parameter. You then need to
normalize the calculated values by
scaling them so that they add up to 1.
After that multiply each input pixel
value with the corresponding scaling
value and add the results together to
get the value of the output pixel.
For example, what does "overlay the input and output" actually mean in programming terms?
In the equation given
lanczos(x) = {
0 if abs(x) > 3,
1 if x == 0,
else sin(x*pi)/x
}
what is x?
As a simple example, suppose I have an input image with 14 values (i.e. in addresses In0-In13):
20 25 30 35 40 45 50 45 40 35 30 25 20 15
and I want to scale this up by 2, i.e. to an image with 28 values (i.e. in addresses Out0-Out27).
Clearly, the value in address Out13 is going to be similar to the value in address In7, but which values do I actually multiply to calculate the correct value for Out13?
What is x in the algorithm?
If the values in your input data is at t coordinates [0 1 2 3 ...], then your output (which is scaled up by 2) has t coordinates at [0 .5 1 1.5 2 2.5 3 ...]. So to get the first output value, you center your filter at 0 and multiply by all of the input values. Then to get the second output, you center your filter at 1/2 and multiply by all of the input values. Etc ...