Re: Loading A Graphic Using CxImage From User Input

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...

Rather than repainting the image on just part of your window, create a small child window the size of the image you want to display. That small window will receive its own paint events and will "clip" properly.

include Win32Lib.ew
without warning 
 
constant Main   = create( Window, "Test", 0, Default, Default, 640, 480, 0 ) 
constant PicWin = create( Window, "", Main, 10, 10, 64, 64, {WS_CHILD,WS_VISIBLE} ) 
 
procedure PicWin_onPaint( integer pSelf, integer pEvent, sequence pParams ) 
 
    copyBlt( PicWin, 0, 0, YourImage ) 
 
end procedure 
setHandler( PicWin, w32HPaint, routine_id("PicWin_onPaint") ) 
 
WinMain( Main, Normal )

Also, you may need to use transBlt() instead of copyBlt() if you need to preserve the transparent background of your image.

-Greg

Thank you, it finally works. I'll make sure to acknowledge all those that helped in my software. Thank you all again.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu