Results 1 to 4 of 4

Thread: Fill polygon on Access Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Fill polygon on Access Form

    I have an Access Form with a picture control and I want to be able to fill Polygons on the picture control at run time. I already have the polygons defined (imagine a map with the states as polygons) and also have the code to detect the mouse moving over different polygons.

    Since Access doesn't provide other than very basic graphics objects, I assume I will need to get a Device Context and call some polygon fill routine from a graphics library. Also, I ca get the the hWnd from the Form, but I'm not sure about getting the device context for painting.

    Anyone have some code that will get the proper device context and call the appropriate routines to fill it with the desired color given my existing polygon X,Y points? (Also, what reference is needed to get the definitions for the required entry points and structures?)

    Thanks
    Sheldon

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Fill polygon on Access Form

    can you use shapes on your form?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Re: Fill polygon on Access Form

    As I mentioned in my original post, this is a form in Microsoft Access, and the available shapes are limited. As far as I can tell, only lines and rectangles are supported. Hence the question on how to paint a polygon.

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Fill polygon on Access Form

    I've not used it in that way before...
    In theory you may be able to write to an image (possibly just in memory) and show the image on the form.
    Possibly you can use the web explorer control to show a web page, inside the page have a canvas and draw to that...

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width