Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regarding Schematic

Status
Not open for further replies.

baigii

Programmer
Joined
Aug 23, 2011
Messages
1
Location
US
Hi everyone .... Im new to TCL.... I have this task wherein I have to write a script to place an Inverter or to draw an inverter using a TCL script... can some one enlighten it as to how to approach this problem
 
Are you asking about drawing a simple shape?

Here's a way to create a bitmap image (in this case as a button icon):
Code:
image create bitmap imgup -data {
#define up_width 16
#define up_height 16
static unsigned char up_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f,
0xfc, 0x1f, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
}
image create bitmap imgdn -data {
#define down_width 16
#define down_height 16
static unsigned char down_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0xf8, 0x3f,
0xf0, 0x1f, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
}
image create bitmap imgT -data {
#define up_width 16
#define up_height 16
static unsigned char up_bits[] = {
0x00, 0x00,
0x00, 0x00,
0x00, 0x30,
0x00, 0x3c,
0x00, 0x3f,
0xe0, 0x3f,
0xf8, 0x3f,
0xfe, 0x3f,
0xfe, 0x3f,
0xf8, 0x3f,
0xe0, 0x3f,
0x00, 0x3f,
0x00, 0x3c,
0x00, 0x30,
0x00, 0x00,
0x00, 0x00
};
}
image create bitmap imgleft -data {
#define up_width 16
#define up_height 16
static unsigned char up_bits[] = {
0x00, 0x00, 
0x00, 0x00, 
0x00, 0x00, 
0x80, 0x00,
0xc0, 0x00,
0xe0, 0x00,
0xf0, 0x00,
0xf8, 0x00,
0xf8, 0x00,
0xf0, 0x00,
0xe0, 0x00,
0xc0, 0x00,
0x80, 0x00,
0x00, 0x00,
0x00, 0x00, 
0x00, 0x00
};
}
pack [button .b -image imgup] -side top

But there are simpler ways to put a shape on a canvas:
Code:
pack [canvas .c -width 500 -height 250]
.c create poly 110 10 110 50 145 30 -fill red

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top