Article # 362, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
How to convert ink objects into bitmaps.
Q. Please tell me how I could convert vm data from inkclass objects into standard bitmap files (e.g. PCX, BMP, etc.). A. Here's an outline of what you need to do to convert ink data to a standard graphics format. The first step would be to instantiate an ink object, and load it with the ink data you want to convert to a bitmap. To convert the ink data to GEOS bitmap format, create a bitmap with GrCreateBitmap() -- this results in a gstate for drawing into the bitmap. Then have the ink object draw itself by sending it a MSG_VIS_DRAW (you might want to pass DF_EXPOSED and DF_PRINT as the draw flags for MSG_VIS_DRAW) passing the gstate of the bitmap. You finally use an export controller in your application to convert the GEOS bitmap data to one of the supported graphics formats (PCX, BMP, etc.). The impex library is covered in chapter 16 of the Objects book. (I would recommend minimum reading of section 16.1.2, 16.2 - 16.2.1.2, and 16.2.3.)