Re: [wxhaskell-users] How to resize a bitmap ?

2011-09-02 Thread Dave Tapley
On 1 September 2011 12:14, D.V. dav.v...@gmail.com wrote:

 Bonjour List,

 If there a way to draw a bitmap so it fits a specific size (rescaling
 it if needed ?)


Erm, well it appears that imageScale is wrapped by wxcore (I'm not sure how
familiar you are with wxHaskell?), so it *might* just work, see here:
http://hackage.haskell.org/packages/archive/wxcore/0.12.1.7/doc/html/Graphics-UI-WXCore-WxcClassesAL.html#g:105

There is a basic image view program here:
http://code.haskell.org/wxhaskell/samples/wxcore/ImageViewer.hs

So it might be fun so see if you can use imageScale easily with that, you
could even extend the sample code to provide zoom functionality and send a
patch back to the list :)

Good luck,
Dave




 I didn't find a way in the docs, but the documentation for drawBitmap
 is thin, wxWidget help didn't help much.

 Thanks !

 David.


 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 wxhaskell-users mailing list
 wxhaskell-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


[wxhaskell-users] How to resize a bitmap ?

2011-09-01 Thread D.V.
Bonjour List,

If there a way to draw a bitmap so it fits a specific size (rescaling
it if needed ?)

I didn't find a way in the docs, but the documentation for drawBitmap
is thin, wxWidget help didn't help much.

Thanks !

David.

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] How to resize a bitmap ?

2011-09-01 Thread Eric Y. Kow
Hi,

On Thu, Sep 01, 2011 at 13:14:48 +0200, D.V. wrote:
 If there a way to draw a bitmap so it fits a specific size (rescaling
 it if needed ?)
 
 I didn't find a way in the docs, but the documentation for drawBitmap
 is thin, wxWidget help didn't help much.

I think you'll want to use the wxImage::Scale function [1], which is
exposed as imageScale in wxcore.

(I don't really remember the details here) It's useful to know that
wxHaskell has an automatically generated bit of Haskell from a C++ = C
wrapper. So if it's in wxWidgets, it may just be buried away in wxcore
somewhere [2], even if it's not exposed with a nice library function or
bubbled up in wx.

The scale function from the wxImage class is called imageScale (the
names are generated automatically: drop the wx, camel case, etc)...

[1]: http://wiki.wxwidgets.org/WxImage
[2]: 
http://hackage.haskell.org/packages/archive/wxcore/0.12.1.7/doc/html/Graphics-UI-WXCore-WxcClassesAL.html

-- 
Eric Kow http://erickow.com


pgpuUCGcFuGu3.pgp
Description: PGP signature
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users