### Author Topic: Clip Boundaries for a Raster  (Read 38554 times)

0 Members and 1 Guest are viewing this topic.

#### ML

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #180 on: November 28, 2007, 05:45:37 PM »

I was actually pretty much done with the whole project then I ran into a situation today where no rasters exisited so I addressed that, then I thought, what if there is more then one in the drawing?

As you know, we can not account for every little thing.

At this point, I think I will leave good enough alone.

Thanks again,

Mark

#### Bob Wahr

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #181 on: November 28, 2007, 05:50:46 PM »
cool dat.

#### ML

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #182 on: November 28, 2007, 05:55:29 PM »

#### ML

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #183 on: December 04, 2007, 04:25:54 PM »

Hey guys

Another question:

Code: [Select]
Dim mdpnt(0 To 2) As Double
mdpnt(0) = (llpnt(0) + urpnt(0)) / 2 'Midpoint (X)
mdpnt(1) = (llpnt(1) + urpnt(1)) / 2 'Midpoint (Y)
mdpnt(2) = 0

And the code to move the raster

Code: [Select]
'Move Points
Dim MPointN(0 To 2) As Double 'Negative
Dim MPointP(0 To 2) As Double 'Positive
MPointN(0) = 0: MPointN(1) = 0: MPointN(2) = 0
MPointP(0) = 0: MPointP(1) = 0: MPointP(2) = 0

'Move Raster
RastImg.Move MPointN, MPointP

Now, what if we want to move the raster from the midpoint that we already have to another midpoint else where, let's say in the middle of a 5'x5' square.

How would we do this:

I realize, we can have midpnt1 and a midpnt2

The question is more, how do we do the actual move with the raster.

Note: Also, this is after it has been clipped

Thanks,

Mark

#### ML

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #184 on: December 04, 2007, 04:30:55 PM »

It looks like we somehow need a way to say move FROM midpnt1

Code: [Select]
Dim mdpnt1 (0 To 2) As Double
mdpnt1(0) = (llpnt(0) + urpnt(0)) / 2 'Midpoint (X)
mdpnt1(1) = (llpnt(1) + urpnt(1)) / 2 'Midpoint (Y)
mdpnt1(2) = 0

Code: [Select]
To Midpnt2 (0 to 2) as Double  'To be determined
Mdpnt2 (0)=
Mdpnt2 (1)=
Mdpnt2 (2)=

So, how does that translate into here?

Code: [Select]
'Move Raster
RastImg.Move Midpnt1 (this is from), Midpnt2 (this is to)

Mark

#### ML

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #185 on: December 05, 2007, 11:19:33 AM »

When you look go to the end of the .move method, it prompts you for a From Point, To Point
In the scenario we originally used, we are giving it the negative and positive coords to move to.

Code: [Select]
RastImg.Move MPointN, MPointP

In the above question, I am looking to truly go from a From Point (mdpnt), to a To Point (mdpnt1)
Just not quite sure how to get it; I have tried a few things but no luck?

Anyone?

Mark

#### David Hall

• Automatic Duh Generator
• King Gator
• Posts: 4075
##### Re: Clip Boundaries for a Raster
« Reply #186 on: December 05, 2007, 02:36:59 PM »
What have you tried?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

#### ML

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #187 on: December 05, 2007, 03:46:34 PM »

Hey CM,
Good to see you back!

So far, I am just grasping for straws, time permitting.

I have tried something like this:

Code: [Select]
'Test Move Points
Dim mdpnt1N(0 To 2) As Double
Dim mdpnt1P(0 To 2) As Double
mdpnt1N(0) = 0: mdpnt1N(1) = 0: mdpnt1N(2) = 0
mdpnt1P(0) = 2.5: mdpnt1P(1) = 2.5: mdpnt1P(2) = 0

'Test Move Raster
RastImg.Move mdpnt, mdpnt1N, mdpnt1P

So, I was trying to use our existing mdpnt which we know is constant each time we define our points to a mid point of a rectangle on a title block; that is where the clipped raster will end up.
So, that would be cool; after the user chooses their points, it will magically get moved to the necessary location for them, assuming I can get it to work.

I think after the move method, we can only use 2 variables and I am using 3 above which did not work for me.

The other thing is that the mdpnt will never be the same, so how do we address that?

We could say mdpnt = RastImg.Origin then perform the move; assuming that will first shift the clipped image to the original raster origin before performing the move.

What do you think?

Thanks

Mark

#### ML

• Guest
##### Re: Clip Boundaries for a Raster
« Reply #188 on: January 14, 2008, 10:52:57 AM »
For those who are interested:
Here is how I finally moved the clipped raster to where I needed it to be on the drawing:

Mark

Code: [Select]
'***Move the raster***
'Use the midpoint of the raster as the base point
Dim Pnt As Variant
Pnt = mdpnt

'0,0
Dim ZeroZero(0 To 2) As Double
ZeroZero(0) = 0: ZeroZero(1) = 0: ZeroZero(2) = 0

'Specify the distance you want to move the raster (midpoint) from 0,0
Dim DestPnt(0 To 2) As Double
DestPnt(0) = ZeroZero(0) + 9.83
DestPnt(1) = ZeroZero(1) + 16.83
DestPnt(2) = 0

'Move the clipped raster to it's destination
RastImg.Move Pnt, DestPnt