Ian,
Have you tried something like:
Dim pixel_x, pixel_y As Integer
Dim WindowSizeX , WindowSizeY As Float
Dim TargetFileName, TargetFileType As String
Dim imageRes As Integer
'Only set pixels in one direction
Pixel_x = 800 'required number of pixels wide
TargetFileName = "A Name including Path"
TargetFileType = "JPEG"
'Get window size from your map...
Set Paper Units "in"
WindowSizeX = WindowInfo(window_id , WIN_INFO_WIDTH)
WindowSizeY = WindowInfo(window_id , WIN_INFO_HIEGHT)
'Set pixels in y direction to match proportion of window.
imageRes = Pixel_x / WindowSizeX
'will generate an image 800 wide and a height in proportion to the window
you saving
'would need to adjust the map window if you want to make a fixed size image.
Save Window window_id
As TargetFileName
Type TargetFileType
Width WindowSizeX Units "in"
Height WindowSizeY [ Units "in"
Resolution imageRes
Haven't debugged it, but the thought is there.
R
-------------------------------------------
Robert Crossley
Agtrix P/L Australia
Far Southern Queensland Office:
9 Short Street
PO Box 63
New Brighton 2483
P: 61 2 6680 1309
F: 61 2 6680 5214
E: [EMAIL PROTECTED]
W: www.agtrix.com
Brisbane Office:
109 Milsom St
Cooparoo 4151
Queensland
P: 61 7 3843 3363
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian Tidy
Sent: 30 January 2006 14:57
To: MapInfo-L
Subject: [MI-L] Help with "Save Window As" Command
Hi All,
I am not having a good day, but it is nearly home time.
I am writing a MapBasic program and trying to use the "Save Window As"
command, but I want to specify type output resolution, but I can't work out
how to specify "Pixels" as my unit type. I have looked in my MapBasic guide
and it doesn't mention pixels.
I am trying to make it so the window size and resolution can be controlled
by the user.
So my question is "How do I set the resolution from MapBasic for the Save
Window As function?"
Cheers Ian
Ian Tidy
GIS Administrator
Works Asset Department
Napier City Council
Hastings St, Private Bag 6010, Napier, New Zealand
Phone +64-6-835-7579 Ext. 8115
Fax +64-6-835-7574
mailto:[EMAIL PROTECTED]
http://www.napier.govt.nz <http://www.napier.govt.nz/>
######################################################################
Attention:
This e-mail message and accompanying data may contain information that
is confidential and subject to legal privilege. Any information
provided is given in good faith. However unless specifically stated to
the contrary, Napier City Council accepts no liability for the
content of this e-mail or for the consequences of any action taken on
the basis of the information provided, unless that information is
subsequently confirmed in writing. If you are not the intended recipient,
you are notified that any use, dissemination, distribution or copying
of this message or data is prohibited. If you received this e-mail
message in error, please notify us immediately and erase all copies
of this message and attachments. Thank you.
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l