Re: About rotation of an icon, and drawing
- From: "Nickolay V. Shmyrev" <nshmyrev yandex ru>
- To: hhamu <hham1024 ybb ne jp>
- Cc: gnome-devel-list gnome org
- Subject: Re: About rotation of an icon, and drawing
- Date: Fri, 02 Dec 2005 13:12:23 +0300
В Втр, 29/11/2005 в 20:43 +0900, hhamu пишет:
> Please let me know about drawing of the icon after affine conversion.
> I have drawn the icon by the following methods now.
> GdkPixmap* icon; //icon(reading)
> GdkBitmap* iconmask; //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);
> 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;
> canvas = GNOME_CANVAS(gnome_canvas_new ());
> gtk_widget_set_usize (canvas, w, h);
> item = gnome_canvas_item_new (GNOME_CANVAS(canvas)
> 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?
Just to not leave this question forgotten:
The way you've provided does draw rotated pixbuf on a canvas, but that
is useful for canvas and it's handled by gnomecanvas internal code.
I suspect you just need something like rotation of pixbuf, that should
be implemented in purely GdkPixbuf oriented code and currently there is
no such function in GdkPixbuf library. Probably you need to write your
own function which do such rotation, moreover, this function can be
jpeg-oriented and take jpeg features into account. Code from canvas can
help you, but you are on your own here.
] [Thread Prev