Re: a little more help...
- Posted by Dan Moyer <danielmoyer at prodigy.net> Jun 20, 2006
- 579 views
Guns wrote: > > Me again, for those of you who remember me.. > > Ive been trying to learn how to display a bmp in euphoria, > i.e create a back ground image, ive read the help files, > but theres still somthing im doing wrong, and i considering im a noob at this, > i dont know what it is. > > And could anyone please send me some source code, of some programs they've > made. > i would just like to read them "study them", so i can gain a better > understanding of how to program with euphoria > > many thanks again.. > > -Guns- Guns, Here is a demo I got out of the demos folder from Win32Lib (it's sometimes easiest to use RunDemos to find useful demos, as it sometimes shows descriptions of what the demos are about). The bitmap itself is, as the code below shows, in the "demoresources" folder under Win32Lib. Example 16:
-- ex16.exw -- -- Display Bitmaps In Window -- Change Control's Font include win32lib.ew without warning ----------------------------------------------------------------------------- VOID = setSearchPaths("..\\demoresources\\") ----------------------------------------------------------------------------- -- controls createForm({ "Test Window, width=50%, height=50%", "Button,OK, left=10, top=10, width=80, height=40," & "font=(Times New Roman,10),tag=1" }) -- load the bitmap constant hBitmap = loadBitmapFromFile("java.bmp") ----------------------------------------------------------------------------- global procedure Paint_TestWindow( integer self, integer event, sequence parms) sequence extent sequence bmsize -- get the window size extent = getCtlSize( self ) bmsize = getCtlSize( hBitmap ) -- fill with the bitmap for i = 0 to extent[1] by bmsize[1] do for j = 0 to extent[2] by bmsize[2] do drawBitmap( self, hBitmap, i, j ) end for end for end procedure registerRoutine("Paint_TestWindow", routine_id("Paint_TestWindow")) ----------------------------------------------------------------------------- global procedure Click_OK(integer self, integer event, sequence parms) -- change the font sequence lTag lTag = getUserProperty(self, "Tag") if lTag[1] then setFont( self, "Times New Roman", 18, Bold+Italic ) else setFont( self, "Times New Roman", 10, Normal ) end if setUserProperty(self, "Tag", not lTag[1]) end procedure registerRoutine("Click_OK", routine_id("Click_OK")) include w32Start.ew