Image Manipulation Form

treva26

Registered User.
Local time
Today, 09:17
Joined
Sep 19, 2007
Messages
113
I have created an image manipulation form, so that users can very simply rotate, crop and resize photos without leaving the database.

It uses the excellent free image software Irfanview, with a Shell call and command line arguments. (You put the path to the Irfanview folder at the start of the module).

The main problem is that if a user clicks a button before the previous command has completed, the whole database crashes. I have tried several bits of code to wait till the shell process finishes, but they dont seem to work with all the command line arguments I need to use.

The second problem is that I cant find a way to get the width and height of the images, which I need in order to crop.
There is code in module 3 that supposedly does this, but I cant get it to work.
 

Attachments

Does the shell close when it has finished processing? If so, you can send keys to it until send keys fails, then you can re-enable user commands.

No clue on the other.
 
With regards to your 2nd problem. This should be a Class Module called CImageInfo.

Move all of that code over to a Class Module, rename it to CImageInfo, then you can call it like below:

Code:
Sub my_test()

Dim temp As New CImageInfo

temp.ReadImageInfo ("C:\MyPicture.jpg")

MsgBox temp.Height

End Sub

Regards,
Pete
 
AWESOME thanks petehilljnr!

Both solutions worked like a charm :)
 

Attachments

Although...despite the fact it waits until the Shell is finished, if you do keep clicking on a button before its ready, it still crashes the whole database...

Any ideas?



Can I disable the left mouse button?

Or is there a cache I can clear that is holding the mouseclicks?
 
Is it the clicking that is crashing it, or is it the event that is firing when you're clicking that is crashing it?

On all of your buttons that call the shell, try disabling the button on the click event entry, and then enabling them on the click event exit.

Otherwise, I'm stumped! Sorry!

Regards,
Pete
 
Yea disabling the buttons works great.
It is still possible to crash it if you click really fast on the same button,
but I can't be expected to make it TOTALLY retard proof!

So here is the final version.

Thanks again for your help :)
 

Attachments

Users who are viewing this thread

Back
Top Bottom