1img-bmp(n) Img img-bmp(n)
2
3
4
5______________________________________________________________________________
6
8 img-bmp - Img, Windows Bitmap Format (bmp)
9
11 package require Tk
12
13 package require img::bmp ?1.4?
14
15 image create photo ?name? ?options?
16
17______________________________________________________________________________
18
20 The package img::bmp is a sub-package of Img. It can be loaded as a
21 part of the complete Img support, via package require Img, or on its
22 own, via package require img::bmp.
23
24 Like all packages of Img it does not provide new commands, but extends
25 the existing Tk command image so that it supports files containing
26 raster images in the Windows Bitmap Format (bmp). More specifically
27 img::bmp extends Tk's photo image type.
28
29 The name of the new format handler is bmp. This handler provides new
30 additional configuration options. See section BMP OPTIONS for more de‐
31 tailed explanations.
32
33 All of the above means that in a call like
34
35 image create photo ?name? ?options?
36
37 [1] Image data in bmp format (options -data and -file) is detected
38 automatically.
39
40 [2] The format name bmp is recognized by the option -format. In ad‐
41 dition the value for the option is treated as list and may con‐
42 tain any of the special options listed in section BMP OPTIONS.
43
45 The handler provides an option to influence the writing of a BMP image.
46
47 -resolution res
48 The display resulation and/or aspect ratio property of the out‐
49 putted bmp file may be set using this option. The default val‐
50 ues are an x and y resolution of 74 dpi. res is a list of 2 or
51 3 elements and may have one of the following formats. The val‐
52 ues xres, yres and unit are specified after the formats.
53
54 res = xres unit
55 Set the same resolution for x and y. Example: Write im‐
56 age with a resolution of 300dpi:
57
58
59 img write out.bmp -format {bmp -resolution {300 i}}
60
61
62 res = xres yres
63 Set the aspect ratio only. The x resolution remains to
64 the default value 74dpi, as the bmp format does not allow
65 to specify the aspect ratio only. The y resolution is set
66 to 74*yres/xres. Example: Write image with an aspect ra‐
67 tio of 1/3:
68
69
70 img write out.bmp -format {bmp -resolution {1 3}}
71
72
73 res = xres yres unit
74 Set an independent resolution for x and y direction. Ex‐
75 ample: Write image with a resolution of x=300dpi and
76 y=150dpi:
77
78
79 img write out.bmp -format {bmp -resolution {300 100 i}}
80
81
82 The used parameters are:
83
84 float xres (input)
85 The output resolution in x direction as a float number.
86
87 float yres (input)
88 The output resolution in x direction as a float number.
89
90 string unit (input)
91 Unit of the given resolution numbers similar to Tk_Get‐
92 Pixel. Possible units are:
93
94 c pixel per centimeter.
95
96 m pixel per meter.
97
98 i pixel per inch.
99
100 p pixel per inch/72 (Printer points).
101
103 img-bmp, img-dted, img-gif, img-ico, img-intro, img-jpeg, img-pcx, img-
104 pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img-tga,
105 img-tiff, img-window, img-xbm, img-xpm
106
108 bmp, image handling, tk
109
111 Copyright (c) 1995-2009 Jan Nijtmans <nijtmans@users.sourceforge.net>
112
113
114
115
116img-bmp 1.4 img-bmp(n)