![]() ![]() ![]() ![]() ( setq isRectClipped ( cdr ( assoc 71 img ) ) ) ( setq u ( nth 0 ( cdr ( assoc 11 img ) ) ) ( if ( equal ( cdr ( assoc 0 img ) ) "IMAGE" ) ( setq img ( entget ( car ( entsel "Select image: " ) ) ) ) Please make sure that the current User Coordinate System (UCS) is set to the World Coordinate System (WCS) before executing this routine. Note: This function only works with raster images in which the Object Coordinate Systems (OCS) is aligned with the AutoCAD World Coordinate System (WCS). The following AutoLISP function extracts the size of a rectangular clipped raster image. The image and the y coordinate of group code 14 are measured from the top of the image. The x coordinate defined in group code 14 are measured from the left side of To get the correct AutoCAD coordinates, you have to add 0.5, 0.5 to the coordinates.Ģ. The clipping coordinates, defined by group code 14, are moved by -0.5, -0.5. The following information is needed to extract the clipping rectangle coordinates:ġ. If the raster image is clipped with an polyline, then the group code 14 is repeated a minimum of three times and contains the vertices (sequential order) of the clipping polyline. The first group code 14 defines the upper left corner, and the second group code 14 defines the lower right corner of the clipping rectangle, in terms of image pixels. If the raster image's clipping mode is rectangular, group code 14 exists twice. There can be more than one group code 14 attached to a raster image. This group code contains the clipping coordinates in image pixels. This is the type of clipping: '1' = rectangular clipped, '2' = clipped with a polyline This flag specifies if the raster image is clipped. To get the size of the image in AutoCAD coordinates, you have to multiply the x-size and y-size with the length of the U- and V-vector. This is the size of the raster image, specified in pixels. It's the same as group code 11 for the y-direction. ![]() The length of this vector is the size of a pixel in x-direction. This the the U-vector of a single image pixel in x direction. The group code is followed by an explanation of what it means: A short explanation of the raster image group codes is useful for this task. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |