' Rapid-Q by William Yu (c)1999-2000 . ' ================================================================================ ' Upload_il_tuo_script_su_Rapidq.it ' 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 RW WG INTEGER 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%, Draw & Fill 6 WG x2%, y2%, c%, Circle fill%) CopyRect SUB (D, Image, D and S are 3 W S) QRECTs, Image can be a QImage, QCanvas, or QBitmap 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%, Draw Bitmap on 3 WG BMP) Canvas FillRect SUB (x1%, y1%, Draws & 5 WG x2%, y2%, c%) Fills a rectangle Line SUB (x1%, y1%, Draws a line 5 WG x2%, y2%, c%) LoadFromFile SUB (FileName$) Load BMP from a 1 W file LoadFromStream SUB (Stream) Load BMP from a 1 W stream Paint SUB (x%, y%, Fill Region 4 WG c%, borderc%) Pset SUB (x%, y%, Pixel plot 3 WG c%) Rectangle SUB (x1%, y1%, Draws a 5 WG x2%, y2%, c%) rectangle Rotate SUB (xOrigin%, Rotates entire 3 W yOrigin%, bitmap at Angle%) specified origin RoundRect SUB (x1%, y1%, Draws & 7 W x2%, y2%, x3%, Fills a rounded y3%, c%) rectangle SaveToFile SUB (FileName$) Save BMP to a 1 W file SaveToStream SUB (Stream) Save BMP to a 1 W stream StretchDraw SUB (Rect AS Draw BMP and 2 W QRECT, BMP) stretch to fit inside Rect TextHeight FUNCTION Returns the 1 W (Text$) AS WORD height, in pixels, of Text$ string TextWidth FUNCTION Returns the 1 W (Text$) AS WORD width, in pixels, of Text$ string TextRect SUB (Rect AS Write text, and 6 W QRECT, x%, y%, clip within S$, fc%, bc%) region Rect TextOut SUB (x%, y%, Writes text to 5 WG S$, fc%, bc%) image 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 ' =============================================================================== ' 2003 Holyguard.net - 2007_Abruzzoweb