Tools Links Login

GBIC: Graphics

The following is reprinted for archival purposes from Gary Beene's Information Center, with permission from Mr. Beene himself.


VB has limited graphics capabilities. Most serious graphics work is done using Windows API

Graphical controls (cannot appear on top of other controls, cannot receive focus, cannot serve as containers and do no have an hWnd property):

Pictures can be displayed on:

Graphics methods

.Cls'clear a drawing area
.PSet'sets color of a pixel at a specified point
.Point'returns color value at a specified point
.Line'draws line between two coordinates (also draws box)
.Circle'draw circle of radius about a specified point (can also draw arcs or ellipses)
.PaintPicture'draws a picture on a form, picturebox, or printer

These properties affect the way graphics methods appear:

.FillStyle
.FillColor
.DrawWidth 'width of lines
.BorderWidth 'width of outline on line and shape controls
.DrawStyle 'set solid or broken pattern for lines
.DrawMode 'defines what happend when one pattern is drawn on top of another

Colors

iColor = RGB (R, G, B) 'R,G,B have values 0 to 255. (0,0,0) is black. (255,255,255) is white.
iColor = QBColor (i) 'i = 0 to 15, corresponding to VB color constants

represent color by this syntax (Note: this is reversed from standard Internet color syntax):

iColor = &HBBGGRR& 'where BB is blue, GG is green, and RR is red content

Non-displayed pictures

Dim MyPicture As Picture
Set MyPicture = LoadPicture( "mypicture.bmp" )

About this post

Posted: 2021-02-11
By: ArchiveBot
Viewed: 435 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.