Image Ocx

Purpose

Creates an Ocx Image control in the current active form, window, or dialog.

Syntax

Ocx Image name = text$ [, id], x, y, b, h [, style%]

text$:control text
id%:control identifier
x, y, b, h:iexp
style%:the control styles

Description

An Image control can display a graphic. An Image control can display a graphic from a bitmap, icon, or metafile, as well as enhanced metafile, JPEG, or GIF files.

The Image control uses fewer system resources and repaints faster than a Form Ocx control, but it supports only a subset of the Form properties, events, and methods. Use the Stretch property to determine whether the graphic is scaled to fit the control or vice versa.

Properties

Appearance | AutoSize | BackColor | BorderStyle | Enabled | Height | HelpContextID | hWnd | Index | Left | MouseCursor | MouseIcon | MousePointer | Name | Parent | Picture | Stretch | TabStop | TabStripIndex | Tag | Tile | Top | ToolTiptext | Transparent | Visible | WhatsThisHelpID | Width

Methods

Move | Refresh | SetFocus | ZOrder

Events

Click | GotFocus | LostFocus | KeyDown | Keyup | KeyPress | MouseDown | MouseUp | MouseMove

Example

Local h As Handle, p As Picture

OpenW Hidden 1, , , 450, 500 : AutoRedraw = 1

BitBlt Screen.GetDC, 0, 0, 400, 400, Win_1.hDC2, 0, 0, SRCCOPY

Set Me = Win_1

Get 0, 0, 399, 399, h

Set p = CreatePicture(h, False)

Cls

Win_1.Show

Ocx Label lbl = "Partial Screenshot:", 10, 10, 100, 15

Ocx Image img = "", 10, 30, 400, 400 : Set img.Picture = p

Do : Sleep : Until Win_1 Is Nothing

Remarks

An Image control can act as a container and can be used in the OcxOcx command.

Note - GFA-BASIC 32 does not provide the PictureBox control as an image container. Instead, the Form Ocx is extended with a Picture property to act as a replacement.

See Also

Ocx, OcxOcx

Animation, CheckBox, ComboBox, Command, CommDlg, Form, Frame, ImageList, Label, ListBox, ListView, MonthView, Option, ProgressBar, RichEdit, Scroll, Slider, StatusBar, TabStrip, TextBox, Timer, TrayIcon, TreeView, UpDown

{Created by Sjouke Hamstra; Last updated: 07/10/2017 by James Gaite}