Categories: S60 | Maemo
This page was last modified 12:15, 19 November 2007.
Using bitmaps with S60 and Maemo Platforms
From Forum Nokia Wiki
Comparison
Comparing S60 and Maemo Platforms
S60 Platform
Maemo Platform
/* create image */
GdkImage* create_image(GdkPixmap* pixmap,GdkDrawable* drawable,gint W,gint H,gint X,gint Y)
{
GdkImage* image1 = NULL;
GdkImage* image2 = NULL;
guint32 ref, pixel;
gint i,j;
image1 = gdk_drawable_copy_to_image(pixmap,NULL,0,0,0,0,W,H);
image2 = gdk_drawable_copy_to_image(drawable,NULL,X,Y,0,0,W,H);
ref = gdk_image_get_pixel(image1,0,0);
for ( i=0; i<W; i++ )
for ( j=1; j<H; j++ )
{
pixel = gdk_image_get_pixel(image1,i,j);
if ( pixel != ref ) gdk_image_put_pixel(image2,i,j,pixel);
}
g_object_unref(image1);
return image2;
}
/* redraw */
void callback_redraw (GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
...
GdkPixmap* pixmap = NULL;
...
pixmap = mainview->pixmaps[index].pixmap;
if ( pixmap!=NULL )
{
gdk_drawable_get_size(pixmap, &width, &height);
if ( spacing(mainview->pixmaps[index].utf_category) )
{
total_width += width;
}
else
{
X = mainview->drawing_area->allocation.width - total_width +
mainview->X + mainview->pixmaps[index].X;
Y = mainview->Y + i * ROW_HEIGHT + mainview->pixmaps[index].Y;
image = create_image(pixmap,widget->window,width,height,X,Y);
gdk_draw_image(widget->window,gc,image,0,0,X,Y,-1,-1);
g_object_unref(image);
}
}
...
}
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Nokia Development Platforms; Request for Expert Speaker | -rgerber- | General Browsing | 0 | 2002-02-06 01:53 |
| Read from a file | sharondeepthi12 | General Symbian C++ | 31 | 2007-10-09 05:16 |
| How to minimize graphics memory consumption | rel1986 | General Symbian C++ | 11 | 2008-02-22 15:39 |
| n00b needs help: s60 & s80 / differences when programming... | ts2000abc | General Symbian C++ | 4 | 2006-04-21 18:45 |
| uiq and s60 | netsjp | Symbian | 4 | 2006-08-31 03:42 |
