Re: Screen Copy onto Window???

new topic     » topic index » view thread      » older message » newer message

Hello again all,

I figured it out but, its somewhat slow.

include win32lib.ew

constant
ScreenBuffer = create( Pixmap, "", 0, 50, 50, 600, 500, 0 )

procedure CopyScreenToBuffer()
  copyBlt( ScreenBuffer, 0, 0, Screen )
end procedure
CopyScreenToBuffer()

constant


procedure cover_up(integer x1, integer y1, integer x2, integer y2)
          -- draw a bitmap using transparency
          atom hDib
          sequence size
          -- get the size of TheWindow
          size = getCtlSize( Win )

           bitBlt( Win,
                  0, 0,
                  ScreenBuffer,
                  50, 50,
                  500, 400,
                  SRCCOPY )

          -- load the bitmap
           hDib = loadBitmapFromFile( "imain.bmp" )

          -- treat the color BrightWhite as transparent
           setTransparentColor( BrightWhite )


           transBlt( Win,    -- destination
                      x1,    -- x position
                      y1,    -- y position
                      hDib ) -- image to copy

end procedure

onPaint[Win]= routine_id("cover_up")

WinMain(Win, Normal )


Now I have to figure out when the user has switched
programs and redraw my program each time.
of course, I guess I could lock them out of being able
to switch but, not very good carma, huh?

Thanks
euman at bellsouth.net


----- Original Message -----
From: "Euman" <euman at BELLSOUTH.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, January 13, 2001 02:20
Subject: Screen Copy onto Window???


> Hello all,
>
> I have a problem that I could'nt find an answer for on
> the listserve (prior post), so here goes.
>
> I have a bitmap that has rounded corners and am setting
> transparent the outter edges of the bitmap (easy enough)
>
> The problem I have is when I create a Window for this
> bitmap to fit ontop of, I want to capture the SCREEN
> in the area of my new Window before I paint it
> and set the captured Screen ontop of the new Window
> before I display my bitmap...
> (much like McAfee does in all their newest ware's)
> essentially hideing the Window with a portion of the screen
> before I drew the Window. If that makes it easier for some.
>
> Here is an attempt (but failure) to do this.
>
> constant
> ScreenBuffer = create( Pixmap, "", 0, 50, 50, 500, 400, 0 )
>
> procedure CopyScreenToBuffer()
>   --myBitmap will start at x = 50 y = 50
>   copyBlt( ScreenBuffer, 50, 50, Screen )
> end procedure
> CopyScreenToBuffer()
>
> constant
> Win=create(Window,"Test",0,50,50,500,400,{WS_POPUP})
>
> procedure CopyBufferToScreen()
>   copyBlt( Screen, 50, 50, ScreenBuffer )
>   repaintWindow ( Win )
> end procedure
> onPaint[Win] = routine_id("CopyBufferToScreen")
>
> What am I doing wrong???
>
> Is there a better, smoother, faster way?
> preferably one that works. hehe
>
> euman at bellsouth.net
>

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu