Page 1 of 1

Converting OLE/ActiveX object data directly to binary inside

Posted: Fri Aug 07, 2009 2:22 pm
by ConvertFromOldNGs
by James Burnby >> Sat, 26 Feb 2000 1:04:36 GMT

Hi,

I'm wanting to be able to convert data from an OLE object embedded with paintbrush directly to an image stored as binary inside the database.

What we have is a form where any user of the system can come along and place a screen shot of something. I have decided to use an ole object embedded with paintbrush. When they click on the ole object it will open up paint brush, they click edit->paste or ctrl+v. They click close and when they click save I'm wanting to be able to convert whatever data is inside the ole object directly to a collection in the database.

I'm rather stumped on how to do this and/or if it is possible. Is this possible and if so how?


Cheers,
James
(Southland Building Society)

Re: Converting OLE/ActiveX object data directly to binary inside

Posted: Fri Aug 07, 2009 2:22 pm
by ConvertFromOldNGs
by Eric Peachey >> Sun, 27 Feb 2000 21:45:26 GMT

I think you'll find that the bitmap will be stored in the OleObject in the oleData property which is an array of OleData objects. I think that you could add a method to OleObject in your schema that would iterate thorught the oleData array and compile a Binary (just add each OleData.block to your Binary and then return it. I think you'll find that this is the bitmap that Paintbrush created. Somebody asked me this yonks ago and I think what I'm suggested should work.

Give it a try and see what you get.

You'll be sidestepping encapsulation etc. and using stuff for internal use so you'll need to consider the usual issues regarding use of unpublished/private stuff.

Eric in Dunedin (lovely day today)