[Top][All Lists]

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

Re: [XForms] How to do animated pixmap objects

From: Serge Bromow
Subject: Re: [XForms] How to do animated pixmap objects
Date: Mon, 19 May 2014 07:22:51 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Bonjour Francis,

I can't help with the buttons. Jens approach looks like the best solution.  With the VU meter this may help. I found an old app that allows a view of a section of a large map in a smaller canvas window. The routines are as follows;

FL_IMAGE *image, *tage;

// The large map is a jpeg.

// Load the entire map into the canvas cv0
if( (image = flimage_load( file )) ){
    flimage_display(image, FL_ObjWin(fd_xs->cv0) );   

// Duplicate the image in tage so we do not disturb the original image
tage = flimage_dup(image);
flimage_scale(tage, 800.0, 600.0, 0);

// display the scaled image on the canvas
flimage_display(tage, FL_ObjWin(fd_xs->cv0) );   

// to crop and display a section of the image, in your case the VU settings.
// flimage_crop(image[0], int xleft, int ytop, int xright, int ybottom);

tage = flimage_dup(image);
flimage_crop(tage, (int) bottom, (int) side, 0, 0);
flimage_display(tage, FL_ObjWin(fd_xs->cv0) );   

Using the "flimage_crop" you can display sections of your image to simulate meter movements. It seems quite responsive clipping an 2166x1368 base image into a 800x600 canvas. I would imagine it would be much faster with a smaller source image into an even smaller display canvas.

Just a thought,


On 05/18/2014 06:23 AM, Francis DUPUIS wrote:
Hi Xforms developers
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
any idea  how to do this?
it seem complicated but will be great improvement of Xforms lib and there users.
Can you help me.
Best Regards
Sorry for my poor english , il is not my native language  (France)

Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection Antivirus avast! est active.

Serge Bromow
DineAmix Inc.
(613) 260-8629
888 411-6636
Ottawa, Canada.

Please Consider the Environment before Printing the E-Mail. 
IMPORTANT NOTICE: This message is intended only for the use of the individual or entity to which it is addressed. The message may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify DineAmix Inc. immediately by email at address@hidden.

Thank you.

reply via email to

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