paste image into a form

G

Guest

i've been trying to get an image pasted into a form (the image is a range
from a worksheet)

i think i have the copy down, but i can't get it pasted into the form

image2 exists on the form and is empty

Worksheets("work order").Range("b2:l51").CopyPicture xlScreen, xlBitmap
seems to copy ok - as i tried pasting by hand into paint and the correct
range is there

however, i can't get the image2 to display this.
ExistingWO is the name of the form
and image2 is the empty image control on the form

what did i miss?
 
G

Guest

thanks! it worked - any ideas on how to scale the image in the clipboard to a
specific size?

i have tried using
ActiveWindow.zoom = 75
before my copy statement, but that doesn't seem to work.
 
A

Andy Pope

Not sure the zoom will affect the captured image.

Can you not set the Image property so the picture is stretch to fit and
then resize the image control?

Cheers
Andy
 
G

Guest

using the following

Image2.AutoSize = True
lPicType = IIf(obMetafile, xlPicture, xlBitmap)
Set Image2.Picture = PastePicture(lPicType)
Image2.Height = 522
Image2.Width = 450

to scale the image works - however, the image is pretty much unreadable.

any suggestions? and you were right, the zoom didn't work - i figured that
since it was taking a 'picture' it might be like the print screen key.
 
A

Andy Pope

Perhaps you will need to adjust the cell sizes and their fonts before
capturing an image.

Alternatively, how about placing the image in a frame and using the
frames scrollbars to move the underlying image. Obviously the user won't
be able to see all the information at once but they will be able to read it.

Cheers
Andy
 
G

Guest

that would work - however the end users of this program aren't the most
computer literate of folk. i was hoping to have it all in one view rather
than scrolling around.

the fonts are at 10 and the cells are already as small as they can be -
which is why i was hoping to scale the image down somehow. i could make the
image larger, but i'm designing on a 21" mon running at 16 x 12 and the users
are on a 17" at 8x6 and 10x7 - so making it larger will cause them more
problems for visibility.

i'll try the frame / scrollbar approach and see if that will do.

thanks!!
 
S

Stephen Bullen

Hi Gixxer,
that would work - however the end users of this program aren't the most
computer literate of folk. i was hoping to have it all in one view rather
than scrolling around.

the fonts are at 10 and the cells are already as small as they can be -
which is why i was hoping to scale the image down somehow. i could make the
image larger, but i'm designing on a 21" mon running at 16 x 12 and the users
are on a 17" at 8x6 and 10x7 - so making it larger will cause them more
problems for visibility.

i'll try the frame / scrollbar approach and see if that will do.

Image scaling will work best with metafiles rather than bitmaps, so:


Worksheets("work order").Range("b2:l51").CopyPicture xlScreen, xlBitmap

would be better as ...CopyPicture xlScreen, xlMetafile
and PastePicture(xlMetafile)

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top