[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua and Win32 API binding.
- From: Hakki Dogusan <dogusanh@...>
- Date: Sun, 16 Dec 2007 00:42:06 +0200
Hi,
Habib wrote:
[snip]
Thefore first I tried: wxWidgets. Dropped it when I couldn't find any
easy way to display a JPEG on the screen. Hacking it will be more
troublesome than it's worth. Add with it the requirement that we need to
capture webcam image and shoot pictures, and things get out of hand fast.
But, wxWidgets can display JPEG images on screen? After seeing your
message, to be sure, I just compile samples/image. JPEG related code
follows:
---------------------------------------------------
#if wxUSE_LIBJPEG
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.jpg")) )
wxLogError(wxT("Can't load JPG image"));
else
{
my_horse_jpeg = wxBitmap( image );
// Colorize by rotating green hue to red
wxImage::HSVValue greenHSV =
wxImage::RGBtoHSV(wxImage::RGBValue(0, 255, 0));
wxImage::HSVValue redHSV =
wxImage::RGBtoHSV(wxImage::RGBValue(255, 0, 0));
image.RotateHue(redHSV.hue - greenHSV.hue);
colorized_horse_jpeg = wxBitmap( image );
}
if ( !image.LoadFile( dir + _T("cmyk.jpg")) )
wxLogError(_T("Can't load CMYK JPG image"));
else
my_cmyk_jpeg = wxBitmap(image);
#endif // wxUSE_LIBJPEG
----------------------------------------------------
-habib.
--
Regards,
Hakki Dogusan