Expand popup form as image grows (1 Viewer)

oxicottin

Just pecking away....
Local time
Today, 06:49
Joined
Jun 26, 2007
Messages
562
Hello, I been trying to figure out a way to expand a popup form as you dbl click inside on the larger image to make it grow in size. If you open form Form1 and select an image then a popup comes up displaying a larger image. I want to take it a step further and as your double clicking the image will get larger "Which it already does" I want the form to grow with the image. How can I do this?

Oh there is a Test image folder it has to be with your accdb file because images are getting pulled from there.
 

Attachments

theDBguy

I’m here to help
Local time
Today, 03:49
Joined
Oct 29, 2018
Messages
10,804
Hi. Try to look up Move or MoveSize method.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:49
Joined
May 21, 2018
Messages
3,196
I would look at some of @isladogs stuff.
 

arnelgp

error reading drive A:
Local time
Today, 18:49
Joined
May 7, 2009
Messages
9,619
You're welcome.
Check also the "anchor" property of the image. I resize the form not the image. The image just resize with the form. Also i added an invisible command butto in front of the image. So the "id" changes when the cmdbutton is click. Clicking the image on any record will always return 1 as the "id" of the table.
 
Last edited:

oxicottin

Just pecking away....
Local time
Today, 06:49
Joined
Jun 26, 2007
Messages
562
You're welcome.
Check also the "anchor" property of the image. I resize the form not the image. The image just resize with the form. Also i added an invisible command butto in front of the image. So the "id" changes when the cmdbutton is click. Clicking the image on any record will always return 1 as the "id" of the table.
Arnelgp, What do you mean "Anchor" property? I did see the cmd button and I noticed the image stays the same size just the visual of it changes. I put a print button incase the user wanted to print the image thinking the image will be the same as what they blew up to see but it prints out the actual saved image size. How could I print it at the zoomed and larger size? I was thinking each time you zoomed it would show you the image size in the header.
 

arnelgp

error reading drive A:
Local time
Today, 18:49
Joined
May 7, 2009
Messages
9,619
it's about the Image's Horizontal/Vertical Anchor property.

I have seen your code and you have there to Resize the image file.
the question is after making it bigger, when we close the image viewer form, should you revert
the image again to it's original size? if you don't do that, when you click it again in the main form
it is already zoomed. and just keep on zooming.
 

oxicottin

Just pecking away....
Local time
Today, 06:49
Joined
Jun 26, 2007
Messages
562
Sorry for the delay.... I would like to keep it at the original size after printing, This keeps the images folder small. Is there a way as the image gets zoomed its creating a temp image and lets say the form gets closed or after you print the image it kills/deletes the temp and you don't even mess with the original.
 

oxicottin

Just pecking away....
Local time
Today, 06:49
Joined
Jun 26, 2007
Messages
562
In this example v2, when you click on the image to open the zoom form It creates a copy of the image in the image folder with a last name .Zoomed.jpg. This is so we can enlarge the image to print it (Which I haven't figured out) then on the zoomed forms unload it deletes the temp image so we don't even interfere with the original.

The question is how do I enlarge the image with each click of the enlarge/zoom button on the image and how can I get the images size (width and height) in a textbox on the form so I know how large it will print out?

Thanks,
 

Attachments

June7

AWF VIP
Local time
Today, 02:49
Joined
Mar 9, 2014
Messages
3,127
Consider code at end of mdEnlargeJobStep_Click()

Debug.Print "Height: " & currHeight & " | Width: " & currWidth

Instead of Debug.Print you can set variables or populate textboxes.
 

oxicottin

Just pecking away....
Local time
Today, 06:49
Joined
Jun 26, 2007
Messages
562
Wouldn't that just show the size of the form? Also what is that in I would need pixels

Height: 8874 | Width: 6936
 

June7

AWF VIP
Local time
Today, 02:49
Joined
Mar 9, 2014
Messages
3,127
I think it is TWIPS. DB has functions to convert pixels to TWIPS as well as reverse. The code to enlarge uses ConvertPixelsToTwips so probably just need to use other function.
 
Last edited:

oxicottin

Just pecking away....
Local time
Today, 06:49
Joined
Jun 26, 2007
Messages
562
I got it working ill upload a working copy tomorrow after I clean it up.... The only thing I cant get working is when I print it still prints the original image.
 

June7

AWF VIP
Local time
Today, 02:49
Joined
Mar 9, 2014
Messages
3,127
I am not getting a saved imaged named zoomed.jpg. Code just opens printer dialog to select destination printer. I printed to PDF and it doesn't matter how enlarged the form is, all outputs are the same size.
 

oxicottin

Just pecking away....
Local time
Today, 06:49
Joined
Jun 26, 2007
Messages
562
I am not getting a saved imaged named zoomed.jpg. Code just opens printer dialog to select destination printer. I printed to PDF and it doesn't matter how enlarged the form is, all outputs are the same size.
that image get created in the images folder with the other images and when you close the popup form it deletes it. I think I might have fixed the issue with not printing the correct image. I think (haven't tested have no printer to waste paper at home :)) What it was doing was grabbing the original image size from Form1 instead of using the path on the popup form that changes.

anyways, im off so Ill check it out better tomorrow but I think its OK. Any idea on how to retrieve the file size using WIA? I cant find any info on that and wanted to add it to the mod_GetImageInformation module.
 

Attachments

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom