[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] How to do animated pixmap objects

From: Jens Thoms Toerring
Subject: Re: [XForms] How to do animated pixmap objects
Date: Sun, 18 May 2014 14:02:35 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Francis,

On Sun, May 18, 2014 at 12:23:49PM +0200, Francis DUPUIS wrote:
> I am working on a project of a remote audio mixing console using Xforms GUI
> i would like to make graphical animated objects  like a rotary 5 postions 
> button or analogic Vumeter based on pixmap include file. They are numerous...
> i have explored  Xforms lib but i really  do not know how to do these 
> animations.
> By example , a 5 positions button 100*100 pixels, the associated pixmap is 
> 100*500 pixels  (or  500*100) .
> and each sub-pixmap is a drawing of a position
> first position display  x=0 y=0 of the pixmap
> 2nd position                 x^0 y=100
> 3rd                                 x=0 y=200
> --
> and so on.
> here is another example with a  2 positions button
> i have written :
> ..#include "but1.xpm" // 2 state button image 64*128 pixel
> --
> obj=fl_add_pixmapbutton (FL_PUSH_BUTTON, 966, 300, 64, 64,  "" );
> fl_set_pixmapbutton_data(obj, but_xpm );
> fl_set_object_boxtype (obj, FL_NO_BOX);
> ----
> it works and display a part of the pixmap
> what i need is a set of  routines  that can offset  x or Y the displayed part 
> of pixmap
> maybe something like
> fl_set_pixmapbutton_data2(obj, but_xpm, offset_x, offset_y )
> and that work with routines like
> fl_set_button_value(obj, val); and fl_ get_button_value
> fl_set dial value(obj,val); and fl_get_dial_value
> also the slider  and postionner

There's no such function. Wouldn't be the simplest solution
to split your pximap from the first example into 5, each with
100x100 pixels and, instead of changing the y-offset, simply
call fl_set_pixmapbutton_data() with the new pixmap to be
shown? That sounds to me a lot simpler than a new function
for setting an offset. Splitting up the exis- ting xpm file
should be relatively straight forward with programs like
'convert' from Image-Magick.
                               Best regards, Jens
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]