Consulting

Results 1 to 9 of 9

Thread: Solved: Graphics manipulation

  1. #1
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399

    Solved: Graphics manipulation

    hey,
    im sure your sick of my suddent onslaught of tricky problems but i have one more and then once these are all sorted out i should be good for a while.

    But just before we get into it im not sure if this is even possible. Essentially our reporting system currently on a button click opens a gif file in the default program on the computer system. We are currently trying to ensure that this is setup correctly so that the image is opened in the graphics editor the client wishes to use. However we sometimes run into problems and issues so i was wonering if it was at all possible to build a small graphics editor (ala Paint / Gimp) in VBA in access for editing the image files directly instead of having to rely on an outside program to get the job done and then hope that everything went ok.

    So if anyone has information on how this might be acomplished it would be apriciated. Note it dosn't need to be photoshop level lol it needs to be able to wrtie text, draw coloured lines and mabye have a fill feature. That should be all it needs.

    Any help is apriciated
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  2. #2
    Good Evening.

    Absolutely anything is possible with enough creativity and manipulation of the system. It all depends on how much effort you want to put into it and how much time you have.

    As usual, there are several ways to do it. But I would highly advise against writing your own graphics editor for it. There are plenty of free sources or source code out there to do this. Besides, Access is not meant to be a graphics editor.


    For a better solution, I would recommend one of two things. The first is to have Access store the information regarding the program the User prefers and open it via code. For example, you can run a Shell("MsPaint.exe ""C:\Windows\Scott's Shirt""") command to open the file specified in the argument using MsPaint.

    The second solution would be to use a UserForm and insert an OLE Object for the selected application. This may be the more appropriate method, but either way, it will enable you a little more control with the right set of code.

    Good luck.
    Scott

  3. #3
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    i looked dor source code but was only able to find VB code.... for like vb6 which i guess i could try opening in vb 2008.

    At the moment we use GIMP and simply associate the .gif format with GIMP.

    And this is probably going to make me sound like a complete begginer but what is an OLE object ? im un familiar with the term.
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  4. #4
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    OLE used to stand for Object Link and Embedding... but now MS has changed their terminology and states that OLE stands for... OLE

    Anyway... you can use OLE to embed an object into Access- in a table you can embed a word document in a field and it will be an individual doc for that record.

    You can also use OLE automation to automate external programs via VBA.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  5. #5
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    !!!

    ok now does this work for all programs ?
    EG could i embed an instance of GIMP into a form ? is that what you are referring to? cos that would be awesome if i could
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  6. #6
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    It really depends on whether or not the program supports OLE Automation. I know nothing of GIMP, so I can't answer for it specifically.

    You can try a few different things:

    1) in a table, see if you can load GIMP as an OLE Object

    2) see if GIMP is an option under the More Controls button of the Form Toolbox

    3) try Demosthine's idea of using a shell command to force GIMP to open the specified file
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  7. #7

    GIMP

    Good Afternoon.

    From Access, to find out if GIMP can be used as an OLE Object, go through the following steps:

    Create a new table in Design View.
    Add a Field Name Graphics. Set the DataType to OLE Object.
    Close and Save the Table.

    Open the table in View Mode.
    Click on the Cell under the Graphics Field.
    Go to the Insert Menu and down to Object...
    Look through the list to find out if you have an OLE Object for GIMP.


    Another option may be to use Gimp-Remote. Check out the GIMP Homepage or the GIMP User Groups. It appears there is a lot of information and tutorials for using their system.

    Happy Hunting!
    Scott

  8. #8
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    well, no OLE Object and no ActivX object under more tools,

    guess i will have to use the specific shell command. I would LIKE to create a graphics program in VBA (if its possible) even if its just for S&G's

    unfortunately i have no idea where to begin. i will stick with the shell command but im going to leave this thread open for now because as i said i would LIKE to get some resources on how i would go about creating a graphics app within access. So any further help is appreciated too

    Interestingly enough you can create a paint ole object in a table though
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

  9. #9
    VBAX Mentor Movian's Avatar
    Joined
    Aug 2008
    Location
    NC, USA
    Posts
    399
    ok i am marking this solved as i have found an interesting solution to the situation at hand.

    instead of directly editing an image via a custom created graphics package. I am instead using and ingenious ( if i do say so myself) usage of word automation.

    I am using the shapes line system to produce arrows and other drawing shapes at determined locations automatically to produce an automatically created diagram based on user value selections within the system. I then discovered that by saving the word doc as an HTML file, word will export two image files, one of the original template image and one with all of the modifications. All i need do is then use the shell command ("with your additional code to force it into gimp (thanks!! )) then i have a diagram with automatically created content and to the user it apears the system has done all of this automaticly and directly

    what you guys think
    "From the ashes of disaster grow the roses of success" - Chitty chitty bang bang

    "I fear not the man who has 10,000 kicks practiced once. I fear the man who has 1 kick practiced 10,000 times" - Bruce Lee

Posting Permissions

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