Page 1 of 1

How to draw text over a bitmap

Posted: Wed Feb 05, 2014 6:50 am
by jdsoft
Hello,

Assume a bitmap that is a ResourceId or a BMP file.
First I load the bitmap, no problem there
I would like to ADD one or mort text labels that overlays the bitmap on specific positions.
This text is different for every record in the database.
Then I want to show this bitmap in an DCREAD GUI.

How can I do this?

Regards,
Jack Duijf

Re: How to draw text over a bitmap

Posted: Wed Feb 05, 2014 8:56 am
by rdonnay
Jack -

I recommend using the STATIC feature of DCPUSHBUTTONXP.
It will let you paint any amount of text over a bitmap and will not function as a button but instead as a STATIC.

Code: Select all

#INCLUDE "dcdialog.ch"
#INCLUDE "dcbitmap.CH"

FUNCTION Main()

LOCAL GetList[0], aCaptions


aCaptions := { ;
  { DC_GetBitMap(BITMAP_BUG_M),, 0,0,300,300,,,}, ;
  { 'This is a', GRA_CLR_BLACK, 50, 20,,,,'24.Arial Bold',,}, ;
  { 'Really Big', GRA_CLR_RED,  150, 20,,,,'32.Arial Bold',,}, ;
  { 'Bug', GRA_CLR_WHITE,  250, 20,,,,'32.Helv Bold',,} }

@ 0, 0 DCPUSHBUTTONXP ;
   SIZE 300,300 ;
   CAPTIONARRAY aCaptions ;
   PIXEL ;
   STATIC

DCREAD GUI FIT TITLE 'Text over a bitmap'

RETURN nil

* ----------

PROC appsys ; RETURN

Re: How to draw text over a bitmap

Posted: Wed Feb 05, 2014 11:47 am
by jdsoft
Hello Roger,

Thank you for the suggestion.
I look in to this today.

Jack