General XMetaL Discussion
gihyunlee November 25, 2008 at 10:17 pm
Image element sizing questionNovember 25, 2008 at 10:17 pmParticipants 4Replies 5Last Activity 14 years, 2 months ago
Hello. I am currently working on an XMetaL document customization and I am having trouble trying to scale down an image that is loaded in a document. Is it possible to scale (or set width/height) of an image element without mapping to the an attribute that contains the width/height/scale? If this is possible, can it be done so that one can rescale the image based on the application window (in author normal view)?
The reason I am asking is because our current DTDs do not have these attributes available thus we need an alternate solution if possible (I.e. using JScript or CSS).
Thanks in Advance.mag3737 November 27, 2008 at 1:44 am
Reply to: Image element sizing questionNovember 27, 2008 at 1:44 am
The simple answer is no: There aren't any APIs that let you do this sort of thing directly through script or direct configuration.
If you want to go to some effort, and depending on your full requirements (e.g. what image types you are working with) there could be workarounds. (From here I'm diving into untested speculation.) For example, you might be able to use an in-place control such as IE to display your images. There's information about In-Place Controls in the XMetaL Programmer's Guide. The OnInitialize macro allows you to set height and width of your control. (But you'd need to know what to set it to, and I don't know how (or even if) you can query the size of the XMetaL application window — an area requiring a little more research.)
Note that OnInitialize only lets you set the height/width at creation time (when the control is originally loaded, i.e. when the graphic is first displayed). The only other event that would let you resize later would be OnFocus, which is probably not idea.
I'm also not sure if IE itself would be a good choice for this control — I don't know how well it would handle image-resizing, or what APIs it has for displaying the image, and it might also matter to you which image formats it supports. Perhaps there are other ActiveX controls that could serve the purpose — yet more research required. Or it might also be possible to create your own custom image viewer control — now you'd really be talking about a lot of effort…gihyunlee November 27, 2008 at 2:07 am
Reply to: Image element sizing questionNovember 27, 2008 at 2:07 am
Thank you for your reply. I assumed that it was not possible, and your reply confirms my assumption :-).
Like you have suggested, the alternative for us will be to embed an in-place control for all the images that will be displayed. We will be doing this using the IsoView activex control since our client has a license for this. This will at least give the client the ability to zoom in/out of images. (We did not want to modify the DTD because the modifications would be XMetaL specific and also because we have the IsoView available to us).
Again thanks for your (and Derek's) quick and detailed replies to all my questions. You guys have been very helpful in unblocking me in all the xmetal customization work I have done.Derek Read November 27, 2008 at 6:30 pm
Reply to: Image element sizing questionNovember 27, 2008 at 6:30 pm
It isn't clear to me if scaling images is necessary for your customization.
If scaling is not a requirement, and your images are a supported type of bitmap (JPG, GIF, BMP, etc) then XMetaL Author renders them at their “default” size (1 pixel = 1 pixel).gihyunlee November 27, 2008 at 8:04 pm
Reply to: Image element sizing questionNovember 27, 2008 at 8:04 pm
We do need to scale the images down in XMetaL (but I don't believe we have the option to pre-scale them beforehand) as the images that are given to us are fairly large in resolution and are ATA standards compliant images, hence most of the image formats are either iso, cgm or tiff. This is the reason why we have the IsoView activex control and application which we need to have integrated with XMetaL.Derek Read November 28, 2008 at 1:21 am
Reply to: Image element sizing questionNovember 28, 2008 at 1:21 am
I see. The only one of those three types (ISO, CGM, TIFF) that is natively supported is TIFF, however, scaling that will require implementing one or more of three attributes for the element: something for width, something for height and/or something for scale. The last one is used by XMetaL Author for our DITA solution but not documented in the Programmer's Guide yet nor is it editable in the XMetaL Developer CTM editor yet, so it would need to be coded by hand using a text editor. For an example see the setting “Scale-Attribute” in this file in XMetaL Author Enterprise 5.1: C:Program FilesXMetaL 5.1AuthorDITAXACstopictopic_ditabase.ctm
The other two image types will require embedding ActiveX controls and in that case (as noted earlier in this thread) you can control the size of the control using script.
- You must be logged in to reply to this topic.