www.pudn.com > src.rar   To Read all the content


[file head]:
/********************************************************************
*
* image cut tool
*
********************************************************************/
#include <tina/all_tina.h>
#include "bmp.h"
static Tv *tv = NULL;
static Tv *tv1=NULL;
#define MAXPATHLEN 64
static char directory_name[MAXPATHLEN];
static char file_name[MAXPATHLEN];
static char pathname[MAXPATHLEN];
static void *pdir=0, *pfile=0;
static int cut_method = 0;

static char filename[MAXPATHLEN];
static Imrect *orig_im =NULL;
static Imrect *dest_im = NULL;
//#define CUTPIX 254.56789
#define CUTPIX 255

static int PERCENT = 50;
static void *pper=NULL;
static int step=5;
static void *pstep=NULL;

static void inc_per_proc(void)
{
PERCENT+=step;
tw_iglobal_reset(pper);
}

static void dec_per_proc(void)
{
PERCENT-=step;
tw_iglobal_reset(pper);
}
/*
static void cut_choice_proc(int val)
{
cut_method = val;
}

*/
static Imrect *read_image(void)
{
Imrect *srcIm;
/*----------------Read the imag
... ...

[file tail]:
... ...
/
tw_newrow();
tw_label("Display");
tw_button("New Tvtool", tool_proc, NULL);
/*---------------------------*/
tw_newrow();
pdir = (void *) tw_sglobal("Directory:", directory_name, 32);
tw_button("scan", scan_proc, NULL);
tw_newrow();
pfile = (void*) tw_sglobal("File:", file_name, 32);
tw_newrow();
/*---------------------------*/
tw_button("push",mypush_proc,NULL);
tw_button("pop",mypop_proc,NULL);
tw_button("show",myshow_proc,NULL);
tw_button("save",mysave_proc,NULL);
tw_newrow();


/*tw_choice("Cut >", cut_choice_proc, 0,\
"25>", "50>", "75>-L_up", "75>-R_up", "75>-L_down", "75>-R_down", "10>", "--", "--", "--", NULL);*/
//tw_iglobal("cut percent: ", &amt;PERCENT, 5);
//tw_label("> ");
pper=tw_iglobal("cut percent:(>)", &amt;PERCENT, 10);
tw_button("<", dec_per_proc, NULL);
tw_button(">", inc_per_proc, NULL);
pstep=tw_iglobal("", &amt;step, 5);
tw_newrow();
tw_button("cut",cut_proc,NULL);

tw_newrow();
tw_end_tool();
}