Skip to content

Update image.draw; image by array with transparency and window.hideKeypad #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions _build/reference/617-graphics-image.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,35 @@ i = Image(k)
Create via 2D array

```
dim a(100, 200)
For y = 0 To Ubound(a, 1)
For x = 0 To Ubound(a, 2)
'Create image array a1 without transparency
dim a1(100, 200)
For y = 0 To 99
For x = 0 To 199
r += 5: g += 10: b += 15
a(y, x) = rgb(r%255, g%255,b%255)
a1(y, x) = rgb(r%255, g%255,b%255)
Next
Next

'Create image array a2 with transparency
'Transparency is a value between 0 and 255
'0 is fully transparent; 255 is solid
dim a2(100, 200)
r = 255: g = 255: b = 255
For y = 0 To 99
alpha = 5
For x = 0 To 199
alpha += 0.1
transparency = round(alpha) * 10
a2(y, x) = (transparency lshift 24) - rgb(r,g,b)
Next
Next
i = Image(a)

'Create and display images
i1 = Image(a1)
i2 = Image(a2)

i1.show(20,20)
i2.show(0,0)
```


Expand Down Expand Up @@ -84,7 +105,7 @@ i = Image(im)

### Show command

zIndex controls whether the image will be displayed over or under another image. Images with higher zIndex values are drawn over the top of images with lower zIndex values. Opacity controls whether to display the image as solid or semi-transparent. Opacity values range from 1-100, with higher opacity values making the image less transparent. The default is 100 resulting in a solid image.
zIndex controls whether the image will be displayed over or under another image. Images with higher zIndex values are drawn over the top of images with lower zIndex values. Opacity controls whether to display the image as solid or semi-transparent. Opacity values range from 1-100, with higher opacity values making the image less transparent. The default is 100 resulting in a solid image. When calling the show command a second time with new coordinates, the image will move to the new position.

```
i.show([x,y [,zindex [,opacity]]])
Expand All @@ -98,6 +119,14 @@ The hide command hides the image from display
i.hide()
```

### Draw command

The draw command draws the image immediately to the screen. Calling the draw command a second time with new coordinates, will draw the same image a second time at the new position to the screen.

```
i.draw([x,y [,opacity]])
```

### Save command

The save command saves the image data into the given file handle, file name or array
Expand Down
15 changes: 15 additions & 0 deletions _build/reference/624-graphics-window.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,21 @@ w.setSize(800, 680)

Raises the virtual keypad on android.

```
w = window()
w.showKeypad()
```

### hideKeypad()

Hides the virtual keypad on android.

```
w = window()
w.hideKeypad()
```


### textScreen()

Select the text mode for output. Text mode can display more text but is slow.
Expand Down