1. wxEuphoria - text on a dc?

This is from the wxEuphoria documentation, under Graphics.

proc begin_drawing( atom dc )
proc blit( atom dstDC, integer dstX, integer dstY, atom srcDC, integer srcX,
integer srcY, integer height, integer width, integer operation )
proc clear_dc( atom dc )   
proc draw_bitmap( atom dc, atom bitmap, integer x, integer y, integer trans )   
proc draw_icon( atom dc, atom icon, atom x, atom y)   
proc draw_line( atom dc, sequence points )   
proc draw_polygon( atom dc, sequence points, atom x, atom y, atom style )   
proc end_drawing( atom dc )   
func get_dc_size( atom dc )   
func get_dc_text_extent( atom dc, sequence text )   
func get_first_region( atom iter )   
func get_next_region( atom iter )   
func get_regions( atom window )   
func get_text_extent( atom win, sequence text, atom font )   
func get_user_scale( atom dc, atom x, atom y )   
proc set_background_mode( atom dc, atom mode )   
proc set_back_brush( atom dc, atom brush )   
proc set_brush( atom dc, atom brush )   
proc set_default_font( atom win, atom font )   
proc set_font( atom dc, atom font )   
proc set_pen( atom dc, atom pen )   
proc set_text_back_color( atom dc, object color )   
proc set_text_color( atom dc, object color )   
proc set_user_scale( atom dc, atom x, atom y )   
proc wx_printf( object win, sequence text, object format )   
proc wx_puts( object win, sequence text )  


I see these things.
proc set_font( atom dc, atom font )   
proc set_text_back_color( atom dc, object color )   
proc set_text_color( atom dc, object color )   

But I don't see any way to put text on a dc.

These are for a win, not a dc.
proc wx_printf( object win, sequence text, object format )   
proc wx_puts( object win, sequence text )  

These things don't provide the necessary information.
wxBitmap
wxBrush 
wxColour 
wxColourDialog 
wxDC 
wxFont 
wxFontEnumerator 
wxIcon 
wxImageList 
wxMemoryDC 
wxPaintDC 
wxPen


Is there a way to write text on a dc. Or on a bitmap?

new topic     » topic index » view message » categorize

2. Re: wxEuphoria - text on a dc?

Jerry Story wrote:
 
> proc wx_printf( object win, sequence text, object format )   
> proc wx_puts( object win, sequence text )  

I read the documentation a little better.

I have this.
bmpSplash = create(wxBitmap,{BM_IN_MEMORY,300,500})
   dc = create(wxMemoryDC,{bmpSplash})


This tries to work and doesn't crash.
   wx_puts({bmpSplash,3,3,dc},"hello")
But it produces garbage.

new topic     » goto parent     » topic index » view message » categorize

3. Re: wxEuphoria - text on a dc?

Jerry Story wrote:
> 
> Jerry Story wrote:
>  
> > proc wx_printf( object win, sequence text, object format )   
> > proc wx_puts( object win, sequence text )  
> 
> I read the documentation a little better.
> 
> I have this.
> }}}
<eucode>
>    bmpSplash = create(wxBitmap,{BM_IN_MEMORY,300,500})
>    dc = create(wxMemoryDC,{bmpSplash})
> </eucode>
{{{

> 
> This tries to work and doesn't crash.
>    wx_puts({bmpSplash,3,3,dc},"hello")
> But it produces garbage.

Here's a quick modification to the splash_demo.exu that comes with the
wxEuphoria demos.  I get a white "Hello, World!" at the top of the 
splash screen.
without warning
include wxeud.e
	
constant 
	Win = create( wxFrame,{0, -1, "Save the Moon! (F1 for Help)", -1, -1} )	,
backgroundBMP = create( wxBitmap, {BM_FROM_FILE, "space.jpg",
wxBITMAP_TYPE_JPEG}) -- the background image

constant
	backDC = create( wxMemoryDC, {backgroundBMP})
set_text_color( backDC, create( wxColour, {255, 255, 255}))
wx_puts({backgroundBMP, 3, 3, backDC}, "Hello, World!")

constant
	splash = create( wxSplashScreen, {backgroundBMP, wxSPLASH_CENTRE_ON_SCREEN ,
		0,  Win,-1})

sleep(2)

destroy(splash)
wxMain( Win )


new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu