Gambas文档
编译和安装
错误消息
代码片段
翻译
废弃的组件
教程
开发环境文档
开发文档
名词解释
如何操作
说明
维基手册
维基搜索
维基许可协议
文档
应用程序仓库
语言概览
语言索引
主题
组件
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.qt
gb.gui.qt.ext
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.io
gb.inotify
gb.logging
gb.map
gb.media
gb.media.form
gb.mime
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
.combobox.item
.container.children
.Menu.Children
.TabStripContainer
.TabStripContainer.Children
.TextArea.Selection
.TextBox.Selection
.Window.Controls
.Window.Menus
_ColumnView_Columns
_ListBox_Item
_TreeView
_TreeView_Item
Action
Align
Animation
Application
Arrange
Border
Button
CheckBox
Clipboard
Color
ColumnView
ComboBox
Container
ContainerChildren
Control
Cursor
Desktop
Dialog
Direction
Drag
Draw
DrawingArea
embedder
Fill
Font
Fonts
Form
Frame
GridView
HBox
HPanel
HSplit
IconView
Image
Key
Label
Line
ListBox
ListView
Menu
Message
Mouse
MovieBox
_new
Path
Playing
Rewind
Paint
PaintBrush
PaintExtents
PaintMatrix
Panel
Picture
PictureBox
Point
Pointer
PointF
Printer
ProgressBar
RadioButton
Rect
RectF
Screen
Screens
Scroll
ScrollArea
ScrollBar
ScrollView
Select
Separator
Slider
SpinBox
Splitter
Spring
Style
SvgImage
TabStrip
TextArea
TextBox
TextLabel
ToggleButton
ToolButton
trayicon
trayicons
TreeView
UserContainer
UserControl
VBox
VPanel
VSplit
Watcher
Window
Windows
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.sdl
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
最近的修改

MovieBox.Mode (gb.qt4)

Property Mode As Integer

Return or set the picture display mode.

It is one of the following constants:

MovieBox.Normal The picture is displayed at it’s original size. No attempt is made to fit the picture to the size of the MovieBox.
MovieBox.Fill The picture is stretched to fit both the width and height of the MovieBox. Proportionality of the picture is not maintained.
MovieBox.Cover The picture proportionality is maintained. The entire MovieBox height and width is filled.
MovieBox.Contain The picture proportionality is maintained. The entire picture is displayed and stretched for best fit.
MovieBox.Repeat The picture is displayed at it’s original size and repeated. The entire MovieBox height and width is filled.

Example

' This demonstrates the PictureBox.Mode constants
' This code needs to be copied to a 'Graphical application'.

Private HBox1 As HBox
Private HBox2 As HBox
Private LabelMode As Label
Private PictureBox1 As PictureBox
Private SliderMode As Slider

Public Sub Form_Open()

  With Me
    .Height = 600
    .Width = 800
    .Arrangement = Arrange.Vertical
    .Padding = 5
  End With

  With HBox1 = New HBox(Me)
    .Height = 21
  End With

  With New Label(HBox1)
    .Expand = True
    .Height = 28
    .Text = "Move slider to change PictureBox Mode"
    .Font.Bold = True
  End With

  With LabelMode = New Label(HBox1)
    .Expand = True
    .Font.Bold = True
    .Alignment = Align.Right
  End With

  With HBox2 = New HBox(Me)
    .Height = 28
  End With

  With SliderMode = New Slider(HBox2) As "SliderMode"
    .MaxValue = 4
    .Mark = True
    .Width = 180
  End With

  If Not Exist("/tmp/test.png") Then
    Me.Show
    Me.Title = "Please wait downloading image...."
    Wait 0.5
    If Not Component.IsLoaded("gb.net.curl") Then Component.Load("gb.net.curl")
    File.save("/tmp/test.png", Object.New("HttpClient").Download("https://gambas.one/files/test.png"))
  End If

  With PictureBox1 = New PictureBox(Me)
    .Expand = True
    .Picture = Picture["/tmp/test.png"]
  End With

  SliderMode.Value = 4

End

Public Sub SliderMode_Change()

  Dim sText As String[] = ["Normal", "Fill", "Cover", "Contain", "Repeat"]

  PictureBox1.Mode = SliderMode.Value
  LabelMode.Text = "PictureBox1.Mode = PictureBox." & sText[SliderMode.Value]
  Me.Title = sText[SliderMode.Value]

End