Rapid-Q Documentation by William Yu (c)1999 Appendix A: QBITMAP


QBITMAP Component

QBitmap is a non-visible component, used to store/retrieve BMP images.

QBitmap Properties
Field Type R/W Default Support





BMP STRING RW W
Use BMP to assign a new bitmap file, or to store BMP in the image cache.
Examples:
DIM Bitmap AS QBITMAP
Bitmap.BMP = "whatever.bmp"
BMPHandle RESOURCE W W
CopyMode INTEGER RW cmBlackness W
Empty INTEGER R W
Font QFONT W W
Handle INTEGER RW W
Height INTEGER RW WG
Monochrome INTEGER RW W
Pixel 2D ARRAY of INTEGER RW WG
PixelFormat INTEGER RW pfDevice W
Top INTEGER RW WG
Transparent INTEGER RW False W
TransparentColor INTEGER RW W
TransparentMode INTEGER RW 0 W
Width INTEGER RW WG


QBitmap Methods
Method Type Description Params Support





Circle SUB (x1%, y1%, x2%, y2%, c%, fill%) Draw & Fill Circle 6 WG
CopyRect SUB (D, Image, S) D and S are QRECTs, Image can be a QImage, QCanvas, or QBitmap 3 W
Example (copies QIMAGE to bitmap at 10,10):
DIM Destination AS QRECT
DIM Source AS QRECT
DIM Image AS QIMAGE
DIM Bitmap AS QBITMAP
Image.BMP = "whatever.bmp"

WITH Destination
.Top = 10
.Left = 10
.Right = .Left+Image.Width
.Bottom = .Top+Image.Height
END WITH
WITH Source
.Top = 0
.Left = 0
.Right = Image.Width
.Bottom = Image.Height
END WITH
Bitmap.CopyRect(Destination, Image, Source)
Draw SUB (x%, y%, BMP) Draw Bitmap on Canvas 3 WG
FillRect SUB (x1%, y1%, x2%, y2%, c%) Draws & Fills a rectangle 5 WG
Line SUB (x1%, y1%, x2%, y2%, c%) Draws a line 5 WG
LoadFromFile SUB (FileName$) Load BMP from a file 1 W
LoadFromStream SUB (Stream) Load BMP from a stream 1 W
Paint SUB (x%, y%, c%, borderc%) Fill Region 4 WG
Pset SUB (x%, y%, c%) Pixel plot 3 WG
Rectangle SUB (x1%, y1%, x2%, y2%, c%) Draws a rectangle 5 WG
Rotate SUB (xOrigin%, yOrigin%, Angle%) Rotates entire bitmap at specified origin 3 W
RoundRect SUB (x1%, y1%, x2%, y2%, x3%, y3%, c%) Draws & Fills a rounded rectangle 7 W
SaveToFile SUB (FileName$) Save BMP to a file 1 W
SaveToStream SUB (Stream) Save BMP to a stream 1 W
StretchDraw SUB (Rect AS QRECT, BMP) Draw BMP and stretch to fit inside Rect 2 W
TextHeight FUNCTION (Text$) AS WORD Returns the height, in pixels, of Text$ string 1 W
TextWidth FUNCTION (Text$) AS WORD Returns the width, in pixels, of Text$ string 1 W
TextRect SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%) Write text, and clip within region Rect 6 W
TextOut SUB (x%, y%, S$, fc%, bc%) Writes text to image 5 WG


QBitmap Examples
DIM BitMap AS QBitMap

BitMap.BMP = "close.bmp"

CREATE Form AS QForm
  CREATE Image1 AS QImage
    Left = 100
    Draw 5, 5, BitMap.BMP
  END CREATE
  Center
  ShowModal
END CREATE

Prev ComponentContentsNext Component