From: Bernie P. <bj...@cs...> - 2004-10-22 09:46:09
|
Hi all, I promised I would send a link to it: http://www.cs.mu.oz.au/~bjpop/code.html There's screenshots also. It is not a very fancy raytracer. Just something simple I made up to show our first year students how you might use Haskell to do graphics. A couple of oddities I noticed: - When you recompile the program and run it for the first time it doesn't get the size of the first window right (its too big). Then when you run it again (and again ...) the window sizing is right. - I can't seem to get transparent bitmaps working properly using drawBitmap The docs say: drawBitmap :: DC a -> Bitmap () -> Point -> Bool -> [Prop (DC a)] -> IO () Draw a bitmap. Takes a bitmap, a point and a boolean that is True when the bitmap is drawn with a transparency mask. I'm using Gimp on linux to make a PNG with transparent background. When the boolean is False the background is painted pinkish. When it is True it is painted white (I would expect it to be transparent, and see the panel underneath). This may very well be a problem with me and not the library, so if anyone has a suggestion I'd like to hear it. Cheers, Bernie. PS Thanks to all those who put in the enormous effort to get wxHaskell going. I was really impressed with the library. I look forward to using it more often. |
From: Daan L. <daa...@xs...> - 2004-10-22 11:24:23
|
Bernie Pope wrote: >I promised I would send a link to it: > > http://www.cs.mu.oz.au/~bjpop/code.html > >There's screenshots also. > > It looks quite cool :-) As soon as I have some time, I'll try it out on windows. > - When you recompile the program and run it for the first time > it doesn't get the size of the first window right (its too big). > > Then when you run it again (and again ...) the window sizing > is right. > > This is a known problem. I think you can solve it by creating the frame with a "visible := False" property, and setting it to true after setting the layout. > - I can't seem to get transparent bitmaps working properly > using drawBitmap > > Can you send me the .png file? I have never tried working with transparent bitmaps and would like to investigate this. There is a good chance that I have done something wrong in my abstractions so we should try some lowlevel calls. All the best, Daan Leijen. ps. Have you looked at the latest direct pixel buffer functions in WXCore.Image? The lastest cvs version contains functions to transform "Array Point Color" arrays into images and bitmaps (but than you need to build wxHaskell yourself) >Thanks to all those who put in the enormous effort to get wxHaskell >going. I was really impressed with the library. I look forward to >using it more often. > > Thanks, this is nice to hear :-) > >------------------------------------------------------- >This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >Use IT products in your business? Tell us what you think of them. Give us >Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >http://productguide.itmanagersjournal.com/guidepromo.tmpl >_______________________________________________ >wxhaskell-users mailing list >wxh...@li... >https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > > > > |
From: Bernie P. <bj...@cs...> - 2004-10-25 07:37:10
|
On Fri, Oct 22, 2004 at 01:28:14PM +0200, Daan Leijen wrote: > Bernie Pope wrote: > > - When you recompile the program and run it for the first time > > it doesn't get the size of the first window right (its too big). > > > > Then when you run it again (and again ...) the window sizing > > is right. > > > > > This is a known problem. I think you can solve it by creating the frame with > a "visible := False" property, and setting it to true after setting the > layout. Yes, that fixes the problem. Thanks. > > - I can't seem to get transparent bitmaps working properly > > using drawBitmap > Can you send me the .png file? I'll send one to you in another mail (not to the list). > All the best, > Daan Leijen. > ps. Have you looked at the latest direct pixel buffer functions in > WXCore.Image? The lastest cvs version contains functions to > transform "Array Point Color" arrays into images and bitmaps > (but than you need to build wxHaskell yourself) I haven't looked. Sounds useful though. I'll probably wait until the next stable realease before I try it. Cheers, Bernie. |