Btnbmp with a line

Post Reply
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Btnbmp with a line

Post by Silvio.Falconi »

is it possible to create a dividing line between the image and the text in a btnbmp?

example

Image


if there is no image the text must be in the center without the line

Image

I saw that if I upload an image on a white background the button then puts the text on a gray background
Any solution ?
Last edited by Silvio.Falconi on Thu Jan 09, 2025 1:33 pm, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Btnbmp with a line

Post by Antonio Linares »

Dear Silvio,

1. You can modify the Class TBtnBmp source code

2. You may try to use oBtnBmp:bPainted
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Btnbmp with a line

Post by Silvio.Falconi »

Antonio Linares wrote: Thu Jan 09, 2025 1:14 pm Dear Silvio,

1. You can modify the Class TBtnBmp source code

2. You may try to use oBtnBmp:bPainted
I was inclined to go with the second option but
the problem is that if the text is bigger you should make the image smaller to give more prominence to the text
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Btnbmp with a line

Post by Antonio Linares »

You may use a TPanel object and paint what you need...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Btnbmp with a line

Post by Silvio.Falconi »

Antonio Linares wrote: Thu Jan 09, 2025 1:42 pm You may use a TPanel object and paint what you need...
Resolved
although maybe I should calculate the length of the caption
oImage:bpainted:= { |hDC| MyLine(hDC,{oImage:nBottom - 50, 1,oImage:nWidth,147 },RGB(195,195,185),RGB(195,195,185)) }


Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Btnbmp with a line

Post by Antonio Linares »

Dear Silvio,

You are a FWH Master already :wink:
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply