Re: How to move the image on a Lead Raster Image
Started by Sohailsoh at 07-03-2008 7:10. Topic has 13 replies.
|
|
07-03-2008, 7:10
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
How to move the image on a Lead Raster Image
|
 
 
|
|
|
Hello All,
Please see the attached image
1) How can i move the image on a Lead Raster Image conrol.
2) How can i disbale the scrol bars.
Please help asap.
Thank you
|
|
|
|
|
Report
|
|
|
|
07-03-2008, 7:11
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
Re: How to move the image on a Lead Raster Image
Attachment: Image.JPG
|
 
 
|
|
|
|
|
|
07-03-2008, 10:57
|
Yasir Alani

Joined on 02-05-2007
Posts 225
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
1) To pan using the mouse, set the RasterImageViewer.InteractiveMode Property to RasterViewerInteractiveMode.pan 2) Set the AutoScroll property to FALSE. Please read the help topic "AutoScroll property (ILEADRasterView)" in the Main COM Object Help file.
Yasir Alani LEADTOOLS Technical Support support@leadtools.com
|
|
|
|
|
Report
|
|
|
|
07-04-2008, 5:45
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
Thank you.
1) But i donot have this property in the control.
Please see the image
2) Ok. Thank you
Please advise further
|
|
|
|
|
Report
|
|
|
|
07-04-2008, 5:45
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
|
|
|
|
|
07-04-2008, 6:12
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
Re: How to move the image on a Lead Raster Image
Attachment: MovingUp.JPG
|
 
 
|
|
|
Please see the attached image,
How would it be possible to move the image towards the Yellos line upwards by keeping the same imge size.
1) RasterImageViewer.InteractiveMode. I donot have this property in RasterView control
Please help asap
Thank you
|
|
|
|
|
Report
|
|
|
|
07-06-2008, 10:45
|
Yasir Alani

Joined on 02-05-2007
Posts 225
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
You are right. That property only exists in our .NET controls, not in our Raster COM objects. Sorry about this mistake. However, there is another way to do it in our LEAD Raster View control, which is using the destination rectangle. First, set the AutoScroll property to False, then specify the location you want using the SetDstRect method.
For an explanation, see the help topic "Specifying Only the Destination Rectangles".
Yasir Alani LEADTOOLS Technical Support support@leadtools.com
|
|
|
|
|
Report
|
|
|
|
07-07-2008, 4:42
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
|
Thank you.
Please let me know what is the difference between .NET controls and COm Objects?
Am i not using the .NET controls? is it better to use the .NET controls?
SetDstRect-> please help me in giving me an example in the mean while i will also try to find it in the topic you specified?
Waiting for your prompt reply
Thank you again.
|
|
|
|
|
Report
|
|
|
|
07-07-2008, 9:14
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
I checked the example you referenced but it is just changing the position of the Raster Viewre COntrol not the position of the image inside.
I want to keep the control on the form as it as and just want to move the image inside it to left, right, top or bottom to be adjusted under the circles.
Please advise further and i really thankful to you for your help and response
Here is the example code....
'Declare variables used for preserving aspect ratios. Dim HeightFactor As Long Dim WidthFactor As Long Dim HeightAllowed As Long Dim WidthAllowed As Long 'Position and size the main form so that it takes up most of the screen. Width = Screen.PrimaryScreen.Bounds.Width * 0.9 Height = Screen.PrimaryScreen.Bounds.Height * 0.8 Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2 Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2 'Turn off automated behavior while we load and manipulate the image.
AxLEADRasterView1.AutoRepaint = False AxLEADRasterView1.AutoScroll = False AxLEADRasterView1.BackErase = False
'Load the bitmap. This hard-coded path name may be different on your system.
'AxLEADRasterView1.Raster.lo("C:\Documents and Settings\Administrator\My Documents\My Pictures\Image1.jpg", 0, 0, 1)
'Set the variables used for preserving the aspect ratio. 'Allow for a border of 1/8 of the form size. 'The units of measure do not matter, since we are calculating proportions. HeightFactor = AxLEADRasterView1.Raster.BitmapHeight WidthFactor = AxLEADRasterView1.Raster.BitmapWidth HeightAllowed = AxLEADRasterView1.ScaleHeight * 3 / 4 WidthAllowed = AxLEADRasterView1.ScaleWidth * 3 / 4
'Center the LEAD control on the form, preserving the aspect ratio. 'Check to see if using the maximum width will make the image too tall. 'Set the dimensions based on the result. If ((WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed Then AxLEADRasterView1.Left = AxLEADRasterView1.ScaleWidth / 8 AxLEADRasterView1.Width = WidthAllowed AxLEADRasterView1.Height = (AxLEADRasterView1.Width * HeightFactor) / WidthFactor AxLEADRasterView1.Top = (AxLEADRasterView1.ScaleHeight - AxLEADRasterView1.Height) / 2 Else AxLEADRasterView1.Top = AxLEADRasterView1.ScaleHeight / 8 AxLEADRasterView1.Height = HeightAllowed AxLEADRasterView1.Width = (AxLEADRasterView1.Height * WidthFactor) / HeightFactor AxLEADRasterView1.Left = (AxLEADRasterView1.ScaleWidth - AxLEADRasterView1.Width) / 2 End If
'Set the image display size to match the LEAD control AxLEADRasterView1.SetDstRect(0, 0, AxLEADRasterView1.ScaleWidth, AxLEADRasterView1.ScaleHeight) 'AxLEADRasterView1.SetDstClipRect(0, 0, AxLEADRasterView1.ScaleWidth, AxLEADRasterView1.ScaleHeight) 'AxLEADRasterView1.SetSrcRect(0, 0, AxLEADRasterView1.Raster.BitmapWidth, AxLEADRasterView1.Raster.BitmapHeight) 'AxLEADRasterView1.SetSrcClipRect(0, 0, AxLEADRasterView1.Raster.BitmapWidth, AxLEADRasterView1.Raster.BitmapHeight) 'Turn on automated behavior while we load and manipulate the image. AxLEADRasterView1.AutoRepaint = True AxLEADRasterView1.AutoScroll = True
|
|
|
|
|
Report
|
|
|
|
07-07-2008, 10:56
|
Yasir Alani

Joined on 02-05-2007
Posts 225
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
Our Raster COM objects can be used with different programming environments, including Visual Studio .NET (any version) and others (VB6, Visual C++ 6, etc.)
Our native .NET classes v14.5 can only be used with Visual Studio .NET 2003 and later.
The design of objects is different between the 2 interfaces. This means a program written using the LEAD Raster COM objects will have to be re-written if you want to convert it to the .NET classes.
If you own LEADTOOLS Raster Imaging Pro 14.5 alone, it does not contain the .NET classes. Higher-end toolkits, such as LEADTOOLS Document and LEADTOOLS Medical toolkits contain both COM and .NET objects.
About SetDstRect, the simplest example is something like this: 'Assuming you have a LEADRasterView control named axLEADRasterView1 axLEADRasterView1.AutoScroll = False axLEADRasterView1.SetDstRect(100, 100, 300, 200)
You can change the 4 values in your code to match the location and size you need exactly.
Yasir Alani LEADTOOLS Technical Support support@leadtools.com
|
|
|
|
|
Report
|
|
|
|
07-14-2008, 8:10
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
Thank you,
This time i got the correct serial number to instal the .NET Controls from support.
Now i have all the required DLLS for Dot Net .
But please let me know how can i add these controls into the toolsbox like the other standard .net controls on this toolbox.
Thank you .
|
|
|
|
|
Report
|
|
|
|
07-14-2008, 11:21
|
Yasir Alani

Joined on 02-05-2007
Posts 225
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
Does this mean you will no longer use the Raster COM objects and instead use the native LEADTOOLS .NET classes? If yes, then you will have to start over and write your application from scratch.
To answer your question, you can find details in the help topic "Loading an Image From a Buffer" in the .NET Class Library (Main) Help file. Please look at the first 5 steps.
Yasir Alani LEADTOOLS Technical Support support@leadtools.com
|
|
|
|
|
Report
|
|
|
|
07-15-2008, 8:41
|
Sohailsoh
Joined on 06-04-2008
Posts 29
|
|
|
Thank you.
I am able to rewrite the code to the point where we were discussing in this post for the last time.
As you can see in this post that i have posted some images with ared rectangle on it.
I have to adjust the image under this rectangle with its eyes under the circles.
I can move the image now on RasterImageViewer1 control with the help of OffSet.
but i am in need of of more help on this point
1) When i rotate the image, the image distorted(Please see image ImageRotation.jpg)
I am using the following code to rotate the image (Angle value is 45 or -45)
Private Sub RotateTest(ByVal image As Leadtools.IRasterImage, ByVal Angle As Integer) Dim command As Leadtools.ImageProcessing.RotateCommand = New Leadtools.ImageProcessing.RotateCommand command.Angle = Angle command.FillColor = New Leadtools.RasterColor(255, 255, 255) command.Flags = Leadtools.ImageProcessing.RotateCommandFlags.None command.Run(image) End Sub
|
|
|
|
|
Report
|
|
|
|
07-15-2008, 11:17
|
Yasir Alani

Joined on 02-05-2007
Posts 225
|
Re: How to move the image on a Lead Raster Image
|
 
 
|
|
|
What do you mean by 'distorted'?
Please send me a small working project (not your full application) that demonstrates the problem you are getting. Pack the project in a ZIP or RAR file and post it here.
If you don't want to post the project here, please email it to support@leadtools.com and mention this forum post.
Yasir Alani LEADTOOLS Technical Support support@leadtools.com
|
|
|
|
|
Report
|
|
|
|
|
LEAD Support Fo... » Developer » Image Processin... » Re: How to move the image on a Lead Raster Image
|
|
Copyright LEAD Technologies, Inc. 2008
