Commit 9447bce6 authored by Cyril Deguet's avatar Cyril Deguet

* get the size of a bitmap

parent df909d84
...@@ -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.4 2003/04/13 22:55:15 asmax Exp $ * $Id: gtk2_bitmap.cpp,v 1.5 2003/04/14 17:03:41 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -109,6 +109,9 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor ) ...@@ -109,6 +109,9 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor )
// Bmp = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, 1, 1); // Bmp = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, 1, 1);
Bmp = NULL; Bmp = NULL;
} }
Width = gdk_pixbuf_get_width( Bmp );
Height = gdk_pixbuf_get_height( Bmp );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y, GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y,
...@@ -165,7 +168,8 @@ void GTK2Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef, ...@@ -165,7 +168,8 @@ void GTK2Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
GdkGC *gc = gdk_gc_new( destImg ); GdkGC *gc = gdk_gc_new( destImg );
/*gdk_pixbuf_render_to_drawable( Bmp, destImg, gc, 0, 0, x, y, w, h, /*gdk_pixbuf_render_to_drawable( Bmp, destImg, gc, 0, 0, x, y, w, h,
GDK_RGB_DITHER_NONE, 0, 0);*/ GDK_RGB_DITHER_NONE, 0, 0);*/
gdk_pixbuf_render_to_drawable( Bmp, destImg, gc, 0, 0, x, y, 50, 50, fprintf(stderr, "draw %d %d %d %d\n", x, y, w, h);
gdk_pixbuf_render_to_drawable( Bmp, destImg, gc, 0, 0, x, y, w, h,
GDK_RGB_DITHER_NONE, 0, 0); GDK_RGB_DITHER_NONE, 0, 0);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_theme.cpp: GTK2 implementation of the Theme class * gtk2_theme.cpp: GTK2 implementation of the Theme class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_theme.cpp,v 1.5 2003/04/13 22:55:15 asmax Exp $ * $Id: gtk2_theme.cpp,v 1.6 2003/04/14 17:03:42 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -320,15 +320,15 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible, ...@@ -320,15 +320,15 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible,
GdkWindowAttr attr; GdkWindowAttr attr;
attr.event_mask = GDK_ALL_EVENTS_MASK; attr.event_mask = GDK_ALL_EVENTS_MASK;
attr.width = 400; attr.width = 0;
attr.height = 150; attr.height = 0;
attr.window_type = GDK_WINDOW_CHILD; attr.window_type = GDK_WINDOW_CHILD;
attr.wclass = GDK_INPUT_OUTPUT; attr.wclass = GDK_INPUT_OUTPUT;
gint mask =0; gint mask =0;
// Create the parent window // Create the window
GdkWindow *gwnd = gdk_window_new( ParentWindow, &attr, mask); GdkWindow *gwnd = gdk_window_new( ParentWindow, &attr, mask );
if( !gwnd ) if( !gwnd )
{ {
msg_Err( p_intf, "CreateWindow failed" ); msg_Err( p_intf, "CreateWindow failed" );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_window.cpp: GTK2 implementation of the Window class * gtk2_window.cpp: GTK2 implementation of the Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_window.cpp,v 1.5 2003/04/13 22:55:15 asmax Exp $ * $Id: gtk2_window.cpp,v 1.6 2003/04/14 17:03:42 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -271,10 +271,10 @@ void GTK2Window::Move( int left, int top ) ...@@ -271,10 +271,10 @@ void GTK2Window::Move( int left, int top )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Window::Size( int width, int height ) void GTK2Window::Size( int width, int height )
{ {
fprintf(stderr, "size %d %d\n", width, height);
Width = width; Width = width;
Height = height; Height = height;
/* SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height, gdk_window_resize( gWnd, width, height );
SWP_NOMOVE|SWP_NOREDRAW|SWP_NOZORDER );*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Window::ChangeToolTipText( string text ) void GTK2Window::ChangeToolTipText( string text )
......
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