Commit 8ec18f34 authored by Cyril Deguet's avatar Cyril Deguet

* remove a small kludge

 * tried to add transparency, but it doesn't work :(
parent be0b6cf0
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_bitmap.cpp: GTK2 implementation of the Bitmap class * gtk2_bitmap.cpp: GTK2 implementation of the Bitmap class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_bitmap.cpp,v 1.9 2003/04/15 20:33:58 karibu Exp $ * $Id: gtk2_bitmap.cpp,v 1.10 2003/04/15 22:16:05 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -110,6 +110,8 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor ) ...@@ -110,6 +110,8 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor )
Bmp = NULL; Bmp = NULL;
} }
Bmp = gdk_pixbuf_add_alpha( Bmp, TRUE, AColor & 0xff, (AColor>>8) & 0xff,
AColor>>16 );
Width = gdk_pixbuf_get_width( Bmp ); Width = gdk_pixbuf_get_width( Bmp );
Height = gdk_pixbuf_get_height( Bmp ); Height = gdk_pixbuf_get_height( Bmp );
} }
...@@ -158,16 +160,11 @@ GTK2Bitmap::~GTK2Bitmap() ...@@ -158,16 +160,11 @@ GTK2Bitmap::~GTK2Bitmap()
void GTK2Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef, void GTK2Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
Graphics *dest ) Graphics *dest )
{ {
/* HDC destDC = ( (GTK2Graphics *)dest )->GetImageHandle();
// New method, not available in win95
TransparentBlt( destDC, xRef, yRef, w, h, bmpDC, x, y, w, h, AlphaColor );
*/
GdkDrawable *destImg = ( (GTK2Graphics *)dest )->GetImage(); GdkDrawable *destImg = ( (GTK2Graphics *)dest )->GetImage();
GdkGC *destGC = ( (GTK2Graphics *)dest )->GetGC(); // GdkGC *destGC = ( (GTK2Graphics *)dest )->GetGC();
gdk_pixbuf_render_to_drawable( Bmp, destImg, destGC, x, y, xRef, yRef, gdk_pixbuf_render_to_drawable_alpha( Bmp, destImg, x, y, xRef, yRef,
w, h, GDK_RGB_DITHER_NONE, 0, 0); w, h, GDK_PIXBUF_ALPHA_BILEVEL, 128, GDK_RGB_DITHER_NORMAL, 0, 0);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool GTK2Bitmap::Hit( int x, int y) bool GTK2Bitmap::Hit( int x, int y)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* window.cpp: Window class * window.cpp: Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: window.cpp,v 1.11 2003/04/15 20:33:58 karibu Exp $ * $Id: window.cpp,v 1.12 2003/04/15 22:16:05 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -410,8 +410,6 @@ void Window::Init() ...@@ -410,8 +410,6 @@ void Window::Init()
// Refresh Image buffer // Refresh Image buffer
RefreshImage( 0, 0, Width, Height ); RefreshImage( 0, 0, Width, Height );
fprintf(stderr, "kludge in window.cpp!\n");
RefreshFromImage( 0, 0, Width, Height );
// Move window as it hasn't been moved yet // Move window as it hasn't been moved yet
Move( Left, Top ); Move( Left, Top );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment