How to draw text over a bitmap

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

How to draw text over a bitmap

#1 Post 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
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to draw text over a bitmap

#2 Post 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
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: How to draw text over a bitmap

#3 Post by jdsoft »

Hello Roger,

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

Jack
Regards,
Jack Duijf

Post Reply