Constructor DxfOle2Frame
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
DxfOle2Frame(byte[])
Makes a static picture of a bitmap or a PNG, as AutoCAD 2021 makes one of a bitmap pasted: the .bmp given, or the
.bmp of 32 bits a pixel the PNG is read into, its alpha laid over white, as the stream CONTENTS of a compound
file of the class StaticDib, as Windows' OLE saves it, behind AutoCAD's head of 128 bytes and with the
extended data AutoCAD writes for it. The library's own: AutoCAD's .NET API makes no OLE
object. The frame stands along x and y with its lower left corner at the origin, at the picture's natural size in
millimetres, its pixels across and up over its pixels a metre (3 780, 96 dots an inch, where the picture gives none):
a picture of 610 by 224 pixels of 96 dots an inch is 161.38 by 59.26. Placed and sized by Position3d,
WcsWidth or TransformBy(GeoTransform3); added to a drawing by
AppendEntity(DxfEntity), which gives it the marks of its space.
public DxfOle2Frame(byte[] picture)
Parameters
picturebyte[]The bytes of a .bmp file (a BITMAPFILEHEADER, then a BITMAPINFOHEADER of 40 bytes or one of its later forms, of 1, 4, 8, 16, 24 or 32 bits a pixel, not compressed: BI_RGB, or BI_BITFIELDS for 16 and 32), or of a .png file of any kind PNG has, of no more than 64 million pixels. A JPEG or another kind is refused: the library reads no other, and the caller turns it into one of these first.
Exceptions
- ArgumentNullException
Thrown when the picture is null.
- ArgumentException
Thrown when the bytes are not such a picture, with the reason.