Draw on a form? (1 Viewer)

ahmed_optom

Registered User.
Local time
Today, 10:47
Joined
Oct 27, 2016
Messages
93
Is there a way to have a control on a form which is like ms Paint?

I am trying to see if it's possible to draw in a form, and save the image.
 

Micron

AWF VIP
Local time
Today, 06:47
Joined
Oct 20, 2018
Messages
3,476
You want to open a form in form view (or maybe design view) and then draw on it with some sort of application tool and what you draw becomes part of the form itself? I'd say no way.

You can do image captures of the form, save them, then open those image files in another application that would allow you to draw on the image and save your additions.
 

Micron

AWF VIP
Local time
Today, 06:47
Joined
Oct 20, 2018
Messages
3,476
I guess I had an entirely different definition of "draw". Or you are saying you can draw on the form with either of those?
 

isladogs

MVP / VIP
Local time
Today, 10:47
Joined
Jan 14, 2017
Messages
18,186
You can draw on the ActiveX control with either of those but each has a different purpose. Try the examples in the link I provided
There may be other ActiveX controls that allow 'drawing' as well
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:47
Joined
Oct 29, 2018
Messages
21,357
Hi. I use the same method as Colin, but I think Lebans has a demo that doesn't use an ActiveX.
 

isladogs

MVP / VIP
Local time
Today, 10:47
Joined
Jan 14, 2017
Messages
18,186
Hi. I use the same method as Colin, but I think Lebans has a demo that doesn't use an ActiveX.

He does indeed. Though most of his stuff is excellent, I don't think this is particularly successful! Its attached if anyone wants to try it.
 

Attachments

  • PaintProgramVer2.zip
    36.2 KB · Views: 109
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:47
Joined
Feb 28, 2001
Messages
26,996
Ahmed_Optom:

Part of the problem is that the Access form builder will not allow drawing. It isn't an easel, it is a BACKGROUND. If you haven't thought about it before, here is the way that forms, reports, and your browser's web pages work:

You start with the basic window. You put in whatever controls, menu bars, etc. are right for that. Then you look at the display area's properties including height, width, positional stuff, and the background info to create a blank slate that is more like a cork-board than an easel.

Then you look at the collection of controls to find their position, type, size, and content. One by one, you stick the controls on the cork-board like a push-pin notice board. To draw something, you would need a control that allows it because the form builder won't. So the immediate answer is "NO" you cannot draw on a form or report.

HOWEVER, there IS such a thing as putting an image on a form. So if you have a pre-generated image, you can plop it as part of the form's background or as a foreground image control.

If you have an MS PAINT compatible image or a JPEG, for that matter, you put an image control on the form and your drawing can be placed just like any other control. However, I think in that case, the control is static and you cannot draw on it any more.
 

ahmed_optom

Registered User.
Local time
Today, 10:47
Joined
Oct 27, 2016
Messages
93
I wanted to thank you all for your contributions and sorry for the delay in my thanks.
 

ahmed_optom

Registered User.
Local time
Today, 10:47
Joined
Oct 27, 2016
Messages
93
Actually you can do so using built in ActiveX controls InkEdit / InkCapture.
For example, see Signature Capture

Hi Colin,

Thanks again for this. However, I did find an annoying and weird bug.

On the signature capture, to retrieve, it works on the first click, but then throws a RTE error on subsquent attempts to retrieve : you entered an expression that has an invalid reference to the property |.

I have played around and cant seem to solve it. Its strange, as it works on the first click, the error highlights the v.ink.load b line.

the relevant code is as follows:

Dim v As Variant
Dim b() As Byte
Set v = Me.InkPicture7
b = Nz(Me.Signature.Value, "")
v.Ink.Load b
Me.InkPicture7.Requery

any ideas?
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 10:47
Joined
Jan 14, 2017
Messages
18,186
Hi
Strange. That never used to occur but I can confirm the same issue now occurs for me.
I'll look into it at some point but not likely to be for a few days.

However for your purposes of drawing on a form, do you actually need the retrieve button?
 

onur_can

Active member
Local time
Today, 03:47
Joined
Oct 4, 2015
Messages
180
Access allows you to draw Line and Rectangle objects only. If you want to decorate your form with different shapes, save your drawing in advanced picture editors. Then, introduce this image to the picture feature of the form.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:47
Joined
Sep 21, 2011
Messages
14,038
Access allows you to draw Line and Rectangle objects only. If you want to decorate your form with different shapes, save your drawing in advanced picture editors. Then, introduce this image to the picture feature of the form.
I think Colin (isladogs) has proved you worng? :)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:47
Joined
Oct 29, 2018
Messages
21,357
Hi Colin,

Thanks again for this. However, I did find an annoying and weird bug.

On the signature capture, to retrieve, it works on the first click, but then throws a RTE error on subsquent attempts to retrieve : you entered an expression that has an invalid reference to the property |.

I have played around and cant seem to solve it. Its strange, as it works on the first click, the error highlights the v.ink.load b line.

the relevant code is as follows:

Dim v As Variant
Dim b() As Byte
Set v = Me.InkPicture7
b = Nz(Me.Signature.Value, "")
v.Ink.Load b
Me.InkPicture7.Requery

any ideas?
Hi. Just curious, could you please test this out for me and let me know if you see the same problem? Thanks!
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:47
Joined
Sep 21, 2011
Messages
14,038
I had tested your sample file a while back. It was working for me. I gave it a try just now. Works perfectly. No error at all with Office 365.
I can't even open it. :)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:47
Joined
Oct 29, 2018
Messages
21,357
I had tested your sample file a while back. It was working for me. I gave it a try just now. Works perfectly. No error at all with Office 365.
@Tera Thanks for checking. Cheers!
 

Users who are viewing this thread

Top Bottom