MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Nov 5th, 2007, 05:02 AM   #1
Jaafar Tribak
 
Jaafar Tribak's Avatar
 
Join Date: Dec 2002
Location: Larache--Morocco
Posts: 2,914
Default Saving a picture of the screen to disk

Hi there,

Is it possible to take a picture of a section of the screen programmatically? if so, how would I , for example, save the Top Right section of the current screen to disk ? the screen section should be determinated with screen coordinates.

Regards.
__________________
Jaafar.

Happiness is when what you think, what you say, and what you do are in harmony.




http://www.laracheenelmundo.com/
Jaafar Tribak is offline   Reply With Quote
Old Nov 5th, 2007, 08:08 AM   #2
Jaafar Tribak
 
Jaafar Tribak's Avatar
 
Join Date: Dec 2002
Location: Larache--Morocco
Posts: 2,914
Default

Ok, I realise that wanting to get a picture of some section of the screen sounds a bit vain if not weird. so let me tell you why i need this.

My real problem is as follows:

I have an oval autoshape placed on a worksheet. The autoshape's background is transparent so i can see through the cells underneath which contain some figures.

When i copy the autoshape i want the underneath cells to be copied a long with it as well . They don't. I just get a copy of the transparent autoshape but without a copy of the cells.

To get around this i thought maybe i should take a picture of the screen region delimiting the autoshape bounderies hence copying all that is on display in that screen region including the background cells.

Copying the underneath cells first then placing the autoshape copy over them wouldn't work for me as the shape is an oval and i ill be using this picture taking repetitively in a timer.

Open to any suggestions .

Regards.
__________________
Jaafar.

Happiness is when what you think, what you say, and what you do are in harmony.




http://www.laracheenelmundo.com/
Jaafar Tribak is offline   Reply With Quote
Old Nov 5th, 2007, 08:15 AM   #3
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,208
Default

Have a look here and adapt as required (If at all)

http://www.xcelfiles.com/EMF_Save.html
__________________
Kind Regards,
Ivan F Moala From the City of Sails
Ivan F Moala is offline   Reply With Quote
Old Nov 5th, 2007, 08:48 AM   #4
Jaafar Tribak
 
Jaafar Tribak's Avatar
 
Join Date: Dec 2002
Location: Larache--Morocco
Posts: 2,914
Default

Thanks Ivan.

Your workbook example uses the clipboard to to get a pointer to the copied selection. It doesn't work for my specific requirement as the underneath cells won't be selected.

If the autoshape was a rectangle, i think i could use the BitBlt function to copy the rectangle Rect onto a memory DC and from there get a pointer to the its picture.

I am experimenting with a transparent autoshape rectangle . If I come up with something that works, i'll post it

Again, thanks for your help.

Regards.


late edit: i've just searched the forum and found this by Tom :http://www.mrexcel.com/board2/viewto...ghlight=bitblt . it may be of interest.
__________________
Jaafar.

Happiness is when what you think, what you say, and what you do are in harmony.




http://www.laracheenelmundo.com/
Jaafar Tribak is offline   Reply With Quote
Old Nov 5th, 2007, 11:45 AM   #5
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,208
Default

Could you explain a bit more about your project?

Is it not possible to select the region of cells beneath the AutoShape ?
as that would be simplest method.
__________________
Kind Regards,
Ivan F Moala From the City of Sails
Ivan F Moala is offline   Reply With Quote
Old Nov 5th, 2007, 08:13 PM   #6
Jaafar Tribak
 
Jaafar Tribak's Avatar
 
Join Date: Dec 2002
Location: Larache--Morocco
Posts: 2,914
Default

Quote:
Could you explain a bit more about your project?

Is it not possible to select the region of cells beneath the AutoShape ?
as that would be simplest method.
Ivan, my ultimate goal is to make a "Magnifying Glass" that the user could freely move over the worksheet and Zoom-In the current region under the glass. That is what I am actually after.Hence the idea to use a transparent oval shape combined with a timer.

I thought maybe the magnifying glass could be made out of a copy of another transparent autoshape in a second window of the same worksheet but with a bigger Zoom ratio. So as the user moves the Glass autoshape say over the range A1:B4, the transparent autoshape moves over the same range in the Zoomed window at the same time using a timer and updates what you see in the magnifying glass .


I hope i am not confusing this further and apologise for rambling around and not being clear about what i am really trying to accomplish.

Anyway, I am open to any suggestions and in the end, I might as well just have to rethink the whole design/logic in order to achieve this "Magnifying Glass" stuff.

Regards.
__________________
Jaafar.

Happiness is when what you think, what you say, and what you do are in harmony.




http://www.laracheenelmundo.com/
Jaafar Tribak is offline   Reply With Quote
Old Nov 6th, 2007, 02:39 AM   #7
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,208
Default

Ah, yes I looked into this briefly a while ago ..... let's see what we can come up with, short of just calling up the Windows Applet that does this.

In fact you could just call this up and keep the Applet on top.
But this would be a good project
__________________
Kind Regards,
Ivan F Moala From the City of Sails
Ivan F Moala is offline   Reply With Quote
Old Nov 6th, 2007, 10:04 AM   #8
Krishnakumar
 
Krishnakumar's Avatar
 
Join Date: Feb 2003
Location: Gurgaon/Thrissur
Posts: 2,326
Default

Hi,

See Aaron's Hover Highlighter
__________________
Kris
Krishnakumar is offline   Reply With Quote
Old Nov 7th, 2007, 10:38 AM   #9
Jaafar Tribak
 
Jaafar Tribak's Avatar
 
Join Date: Dec 2002
Location: Larache--Morocco
Posts: 2,914
Default

Thanks Krishnakumar.

I hav actually come up with something that seems to work quite well. See here : http://www.mrexcel.com/board2/viewto...548&highlight=

Regards.
__________________
Jaafar.

Happiness is when what you think, what you say, and what you do are in harmony.




http://www.laracheenelmundo.com/
Jaafar Tribak is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 03:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.