About rotation of an icon, and drawing
- From: "hhamu" <hham1024 ybb ne jp>
- To: <gnome-devel-list gnome org>
- Subject: About rotation of an icon, and drawing
- Date: Tue, 29 Nov 2005 20:43:56 +0900
Hi.
Please let me know about drawing of the icon after affine conversion.
I have drawn the icon by the following methods now.
------------------
GdkPixmap* icon[100]; //icon(reading)
GdkBitmap* iconmask[100]; //mask(reading)
GdkPixmap* jpgimage; //drawing area
void draw_icon(int symbol_no)
{
GtkWidget *draw_area=lookup_widget(GTK_WIDGET(gl_main_wnd),"draw_area");
GdkGC *gc=gdk_gc_new((GdkDrawable*)draw_area->window);
gdk_window_get_size(icon[symbol_no],&w,&h);
gdk_gc_set_clip_mask(gc,iconmask[symbol_no]);
gdk_gc_set_clip_origin(gc,symbol_posx,symbol_posy);
gdk_draw_pixmap(jpgimage,gc,iconmap[symbol_no],0,0,0,0,w,h);
gdk_gc_destroy(gc);
}
--------------------
An icon file is reading with a "gdk_pixmap_create_from_xpm" .
I want to apply affine conversion in order to rotate an icon.
void AffineConv (GdkPixbuf *pixbuf,double w,double h,double r)
{
GnomeCanvas *canvas;
GnomeCanvasItem *item;
double affine[6];
canvas = GNOME_CANVAS(gnome_canvas_new ());
gtk_widget_set_usize (canvas, w, h);
item = gnome_canvas_item_new (GNOME_CANVAS(canvas)
,gnome_canvas_pixbuf_get_type()
,"pixbuf",pixbuf,NULL);
art_affine_rotate(affine,r);
gnome_canvas_item_affine_absolute(item,affine);
}
I want to draw the item after conversion in jpgimage.
However, I do not understand the drawing method.
How is what is necessary just to carry out, in order to draw?
Or is making GdkPixbuf from GnomeCanvasItem possible?
Sorry.
I am poor at English.
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]