oSay background

oSay background

Postby Otto » Thu Dec 13, 2007 3:32 pm

Is such a background possible with pure FIVEWIN code.

Image
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Thu Dec 13, 2007 4:12 pm

Yes, using a brush
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Otto » Thu Dec 13, 2007 4:18 pm

Thank you.
Excuse my ignorance. But if I tried with brush I always have full color.
This seems to be gradient.
Best regards,
Otto
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Thu Dec 13, 2007 4:37 pm

You have to create a brush from a bitmap, and the bitmap has the painted gradient :-)

DEFINE BRUSH oBrush RESOURCE <cBmpResName>

or

DEFINE BRUSH oBrush FILENAME <cBmpFileName>
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Otto » Fri Dec 21, 2007 7:54 am

Is this the right way to make such a outlook:

Paint a rectangle with
FillRect(oWnd:hDc,aRect1,oBrush:hBrush)
And then paint the text with oWnd:Say
oWnd:say( nRow, nCol, text ,"W",::nClrBack,oFont,.T.,.t.)
Thanks in advance
Otto
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Fri Dec 21, 2007 9:59 am

Otto,

There are two ways to paint a text:

1. Use the oWnd:Say(), as you have done

2. Use a SAY control: @ ..., ... SAY ...

The advantage of using the 2) is that you don't have to repaint it. The control automatically paints itself. With 1) you have to paint the text everytime the window is repainted

My advice is to use a SAY control that uses a brush with a gradient
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Otto » Fri Dec 21, 2007 10:31 am

>My advice is to use a SAY control that uses a brush with a gradient

I don't know how to do this?

Would you be so kind to show some code.
Thanks in advance
Otto
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Fri Dec 21, 2007 1:07 pm

Otto,

Its a simple solution, though we could improve it:
http://www.hotshare.net/file/24901-201766470d.html

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests