Button and Insert Image

B

Bryan Hughes

Hello,
How would I program a button to insert a specific picture into a field?

Example: User has a digital image of their personal signature. After
completing the form, they can add this image to a field by clicking a
button.

-TFTH
Bryan
 
B

Bryan Hughes

How can you control the picture that they can insert without showing it as
the default image?

The reason for the button is to add a UI message before inserting the image.
How can I do this?

-TFTH
Bryan

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
The Picture control has this functionality built right into it. When you
have a Picutre control in your view, the form user clicks on that, and it
allows them to select a picture. That picture is then inserted.

If you want multiple pictures, makre sure your Picture control is in a
Repeating Group.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hello,
How would I program a button to insert a specific picture into a field?

Example: User has a digital image of their personal signature. After
completing the form, they can add this image to a field by clicking a
button.

-TFTH
Bryan
 
M

Matthew Blain \(Serriform\)

What's the source of the image you want to insert?

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Anyone else want to jump in here?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



How can you control the picture that they can insert without showing it as
the default image?

The reason for the button is to add a UI message before inserting the image.
How can I do this?

-TFTH
Bryan

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
The Picture control has this functionality built right into it. When you
have a Picutre control in your view, the form user clicks on that, and it
allows them to select a picture. That picture is then inserted.

If you want multiple pictures, makre sure your Picture control is in a
Repeating Group.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hello,
How would I program a button to insert a specific picture into a field?

Example: User has a digital image of their personal signature. After
completing the form, they can add this image to a field by clicking a
button.

-TFTH
Bryan
 
B

Brian Teutsch [MSFT]

If all you want is a UI warning, use Rules (or the OM) to show an Alert when
that field changes.

If you need to do more things (like verifying the image), you can turn off
user's ability to insert images while you're designing a form. Then, your
code will have to cover all the file browsing (req. trusted form), Base64
encoding and DOM insertion.

Brian

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Anyone else want to jump in here?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



How can you control the picture that they can insert without showing it as
the default image?

The reason for the button is to add a UI message before inserting the image.
How can I do this?

-TFTH
Bryan

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
The Picture control has this functionality built right into it. When you
have a Picutre control in your view, the form user clicks on that, and it
allows them to select a picture. That picture is then inserted.

If you want multiple pictures, makre sure your Picture control is in a
Repeating Group.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hello,
How would I program a button to insert a specific picture into a field?

Example: User has a digital image of their personal signature. After
completing the form, they can add this image to a field by clicking a
button.

-TFTH
Bryan
 
B

Brian Teutsch [MSFT]

Then it's the method I described below. If you put your file server on the
same domain as your form, you might be able to avoid trusted form
requirements. But there's definitely some code to go and fetch the image and
encode it via Base64.

Brian

Bryan Hughes said:
Brian,

I want the user to only be able to insert a specfic image.

Brian Teutsch said:
If all you want is a UI warning, use Rules (or the OM) to show an Alert when
that field changes.

If you need to do more things (like verifying the image), you can turn
off
user's ability to insert images while you're designing a form. Then, your
code will have to cover all the file browsing (req. trusted form), Base64
encoding and DOM insertion.

Brian

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Anyone else want to jump in here?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



How can you control the picture that they can insert without showing it
as
the default image?

The reason for the button is to add a UI message before inserting the image.
How can I do this?

-TFTH
Bryan

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
The Picture control has this functionality built right into it. When you
have a Picutre control in your view, the form user clicks on that, and it
allows them to select a picture. That picture is then inserted.

If you want multiple pictures, makre sure your Picture control is in a
Repeating Group.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hello,
How would I program a button to insert a specific picture into a field?

Example: User has a digital image of their personal signature. After
completing the form, they can add this image to a field by clicking a
button.

-TFTH
Bryan
 
M

Matthew Blain \(Serriform\)

Just as Brian mentions elsewhere on this thread, you'll need to write code
to do this. If your server is an HTTP server, you can use XMLHTTP (I'm
assuming you're using script) to GET the data, then use a nodetypedvalue to
base64 encoded the data and copy it into the InfoPath form. With the .NET
framework, use the WebClient and Convert.ToBase64String.

--Matthew Blain
http://tips.serriform.com/


Bryan Hughes said:
My local file server

-TFTH
Bryan
Matthew Blain (Serriform) said:
What's the source of the image you want to insert?

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Anyone else want to jump in here?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



How can you control the picture that they can insert without showing it as
the default image?

The reason for the button is to add a UI message before inserting the image.
How can I do this?

-TFTH
Bryan

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
The Picture control has this functionality built right into it. When you
have a Picutre control in your view, the form user clicks on that, and it
allows them to select a picture. That picture is then inserted.

If you want multiple pictures, makre sure your Picture control is in a
Repeating Group.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hello,
How would I program a button to insert a specific picture into a field?

Example: User has a digital image of their personal signature. After
completing the form, they can add this image to a field by clicking a
button.

-TFTH
Bryan
 

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