1. a little more help...

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-

new topic     » topic index » view message » categorize

2. Re: a little more help...

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


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

3. Re: a little more help...

Guns wrote:

> 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

Included in the download package are many demonstration programs. These 
are located in a folder \euphoria\demos.

Included in the demonstrations programs are many that start with 
bitmap**. They all handle bitmaps.

Studying those programs, changing them, breaking them, enhancing them 
should answer all of your questions.

-- 
Craig

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

4. Re: a little more help...

> 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

Are you trying this in Windows, DOS or Linux? In Windows, with
Win32Lib, there are various Graphics functions that handle loading and
displaying bitmaps.

~Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu