Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with wvt_drawimage after wvt_setfont

68 views
Skip to first unread message

Mike Evans

unread,
Sep 17, 2007, 6:57:37 AM9/17/07
to
I have the following problem with wvt.
The image does not display after call the wvt_setfont function.
To run the code please change lala.bmp with a valid bmp file.

#include "wvtwin.ch"

REQUEST HB_GT_WVt
REQUEST Wvt_GetScreenWidth
REQUEST WVt_SetFont
REQUEST WVt_SetCodePage


Procedure Main()
wvt_core()
//wvt_utils()
//WVt_SETCODEPAGE(255)
wvt_drawimage(0,2,2,20,40, "c:\lala.bmp")
@10,37 say "Before setfont"
inkey(0)

wvt_SETFONT( "Lucida Console", 39, 16, 0,0)

wvt_drawimage(0,2,2,20,40, "c:\lala.bmp")
@11,37 say "After setfont"
Inkey(0)
Return

bill robertson

unread,
Sep 17, 2007, 9:22:04 AM9/17/07
to
"Mike Evans" <maki...@hotmail.com> wrote in message
news:46ee5f66$0$1339$834e...@reader.greatnowhere.com...

>I have the following problem with wvt.
> The image does not display after call the wvt_setfont function.
> To run the code please change lala.bmp with a valid bmp file.
>
Hi Mike

You seem to be saying you see the bitmap before the wvt_setfont() function.
I don't see the bitmap before or after the wvt_setfont. I am using Borland
BCC on Windows XP and lastest CVS.


Mike Evans

unread,
Sep 17, 2007, 9:49:06 AM9/17/07
to

Bill,
Exactly. I'm seeing the bitmap before the first call to wvt_setfont. After
this call, any drawimage does not work at all. I'm using Xharbour Builder
RC17

Regards
Mike Evans

bill robertson

unread,
Sep 17, 2007, 10:48:55 AM9/17/07
to
"Mike Evans" <maki...@hotmail.com> wrote in message
news:46ee873d$0$1346$834e...@reader.greatnowhere.com...

Hi Mike,

I wondered why I had to comment out your 'REQUEST HB__GT_WVt'. I just built
your program with the evaluation version of xHarbour Builder (v4.5 Dated
20070813). I get the same results as the xHarbour.org version. I don't see
the bit-map before or after the call to setfont.


Mike Evans

unread,
Sep 17, 2007, 10:53:25 AM9/17/07
to
On Mon, 17 Sep 2007 10:48:55 -0400, bill robertson wrote:

> why

Bill,
I'm not sure but try to change wvt_drawimage(0,2,2,20,40, "c:\lala.bmp") to
wvt_drawimage( 2,2,20,40, "c:\lala.bmp") // Be sure that exists a bitmap
lala.bmp on the root folder of c:\

Regards
Mike Evans

Pritpal Bedi

unread,
Sep 17, 2007, 1:54:25 PM9/17/07
to
Hi Mike

> wvt_drawimage(0,2,2,20,40, "c:\lala.bmp")

> inkey(0)
>
> wvt_drawimage(0,2,2,20,40, "c:\lala.bmp")

Please check the parameters for WVT. You are using parameters effective for
WVW.

wvt_drawimage( 2,2,20,40, "c:\lala.bmp" ) => See first parameter which I
removed, a window identifier.

Will show up everytime you call it regardless of font setting which has
nothing to do with this function.

Regards
Pritpal Bedi


bill robertson

unread,
Sep 17, 2007, 6:24:23 PM9/17/07
to
"Mike Evans" <maki...@hotmail.com> wrote in message
news:46ee873d$0$1346$834e...@reader.greatnowhere.com...

Mike,

I don't know what I did wrong earilier, but the following now works both in
xHarbour and xHarbour Builder Demo.

//-------------------------------------------------------------------------
#include "wvtwin.ch"

Procedure Main()
LOCAL cFile:= "c:\lala.bmp"

wvt_core()

IF File( cFile )
Alert( cFile + ": Found OK" , " ",, 2 )
ELSE
Alert( cFile + ": Not found!", " ",, 2 )
RETURN -1
END IF

wvt_drawimage(2,2,20,40, "c:\lala.bmp")


@10,37 say "Before setfont"
inkey(0)

wvt_SETFONT( "Lucida Console", 39, 16, 0,0)

Clear Screen

@10,25 say "Just Set Font to Lucida Console"
Inkey(0)

Clear Screen
wvt_drawimage(2,2,20,40, "c:\lala.bmp")

Mike Evans

unread,
Sep 18, 2007, 7:14:49 AM9/18/07
to

Pritbal,
I've tried both but none of this works. The solution is to use a clear
screen before the second drawimage, but i dont know why. Also i'm trying to
understand how wvt-wvw works and make some changes. The first change was to
'translate' close window button to ESC key. Now i'm trying to support
window maximize and window resize (change font size to fit the new size of
the window). If you can help i would be thankfull.

Thanks in advance
Mike Evans

0 new messages