picture in vdx file (xml visio)

A

aalroubaie

hi,
i am generating vdx file at run time, some of vdx file data come fro
database, all thing is well except if i have a picture and want t
display it, so the problem as the following:

if you have a picture stored in a table in the database (in blo
field), how you can represent this picture data in the vdx file t
display it on visio page? (remember you didn’t get this picture fro
existing vdx or visio file, it came from another module in the system)

sample:
<ForeignData ForeignType='Bitmap' CompressionType='JPEG
CompressionLevel='0.05'>
/9j/4AAQSkZJRgABAgEASABIAAD/4QmkRXhpZgAASUkqAAgAAAAHABIBAwABAAAAAQAQERoBBQABA
AAAYgAAABsBBQABAAAAagAAACgBAwABAAAAAgAAADEBAgAXAAAAcgAAADIBAgAUAAAAigAAAGmHBA……………………………
………………………………

i don’t know how visio represent the picture data in vdx file, its no
binary, and its unpractical to deal with this method, so i think ther
is two gates for that:

1-find a way to make the picture as a linked object and display th
picture depend on picture file separated from vdx file (as link object
, and i don’t think this acceptable in xml vdx files.
2-find the format the represent the picture inside vdx file.

there is also unpractical solution by upload each picture that i wan
to use it in vdx file by insert it at the first in a temporary visi
file then read the data of the picture to reuse it in the future fo
other vdx files.

if you have a solution or have a more specific forums for microsof
visio , plz write it
best regard
 
C

Chris Roth [MVP]

Hi aalroubaie,

I'm doing something similar these days as well, although with metafiles.

If I read a metafile straight from it's .wmf file, I can base64 encode the
thing and stuff it into a .vdx file.

Problem is, I had to ignore the first 23 bytes that get read. I don't know
if this offset will be good for every single metafile I will encounter, but
at least we've gotten started.

What you can do is:

1. base64 encode your from-database data
2. base64 DEcode the same info as it gets stored in a .vdx file (you'll have
to create this file the hard way, of course)
3. compare the bits to see if you have an offset, or any kind of match at
all.

--
Hope this helps,

Chris Roth
Visio MVP

www.wanderkind.com/visio
 
A

aalroubaie

thanks roth,
i think this is reasonable, i have make a quick research and it seem
to me is related about base64, so the image start to be clear to me i
how deal with the picture in vdx file. i will try this solution as soo
as possible, because i have other problems i need to solve it firs
before doing that.
thanks again roth
best regard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top