This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, January 15, 2007 12:21:40 AM(UTC)
Groups: Registered
Posts: 8
Hi.
I'm looking for the easiest way to "shrink" a scanned picture.
I need a 10% smaller duplicate of my previous scanned picture,
but it's got to have the same size. I need a border arround my picture,
that's why I have to shrink it.
#2
Posted
:
Monday, January 15, 2007 3:41:55 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
What is the exact LEADTOOLS version that you use?
And what is the programming interface that you use?
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Monday, January 15, 2007 6:11:43 AM(UTC)
Groups: Registered
Posts: 8
Leadtools 11.5 with VB.NET 2003
#4
Posted
:
Tuesday, January 16, 2007 8:58:59 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
You can use the Size method (Main Control) to resize the bitmap to a new width and height.
For more information, please refer to the LEADTOOLS documentation and read the related topic.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#5
Posted
:
Wednesday, January 17, 2007 4:15:12 AM(UTC)
Groups: Registered
Posts: 8
i try to show you exactly, what i need.
i want to make a new picture, whch has got the same resolution,
like the original.
but shows a smaller duplicate of the original
centered in it.
VB.NET2003 activex leadtools 11.5
is there a way to realize this?
thanks stefan
hennicken attached the following image(s):
#6
Posted
:
Thursday, January 18, 2007 6:22:46 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Actually, the Size method is one step. The full steps are:
1. Use a second control and create a blank image with the same size and pixel depth as the original using CreateBitmap method.
2. Fill the new image with the border color you want using the Fill method
3. Resize (shrink) the original image using the Size method
4. Copy the pixel data from the 'shrunk' image to the new image using the Combine method.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#7
Posted
:
Wednesday, January 31, 2007 5:58:47 AM(UTC)
Groups: Registered
Posts: 8
Hello again,
the solution works well, but now i've got another problem.
i can't see the whole picture. i need a smaller copy of my picture,
but i get only a section of my picture as i try to show you in my picture.
Could you please help me again?!?!
hennicken attached the following image(s):
#8
Posted
:
Wednesday, January 31, 2007 9:24:09 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
Make sure you are completing Maen's step 3 properly before combining as in Step 4. The image you combined onto the black background is the same size and it looks like you only cropped the image rather than shrinking it with using the Size method.
#9
Posted
:
Wednesday, January 31, 2007 10:33:03 PM(UTC)
Groups: Registered
Posts: 8
I think i did it right, but thats's my code
AxLEAD1.Load("c:\test.tif", 1, 1, 1)
AxLEAD2.CreateBitmap(AxLEAD1.InfoWidth, AxLEAD1.InfoHeight, 1)
Dim leadsize As System.Drawing.Size
leadsize = New System.Drawing.Size(AxLEAD1.InfoWidth * 0.94, AxLEAD1.InfoHeight * 0.94)
AxLEAD1.Size = leadsize
AxLEAD2.BitmapHeight = AxLEAD1.InfoHeight * 0.94
AxLEAD2.Size = leadsize
AxLEAD2.Fill(System.UInt32.Parse("FFFFFF", Globalization.NumberStyles.HexNumber))
AxLEAD2.Combine(AxLEAD2.Width * 0.03, AxLEAD2.Height * 0.03, AxLEAD2.Width * 0.94, AxLEAD2.Height * 0.94, AxLEAD1.Bitmap, 0, 0, 801)
AxLEAD2.ForceRepaint()
AxLEAD2.AutoRepaint = True
AxLEAD1.Visible = False
AxLEAD2.Top = 0
AxLEAD2.Left = 0
AxLEAD2.Width = 200
AxLEAD2.Height = 200
AxLEAD2.Flip()
AxLEAD2.Save("c:\test2.tif", 29, 1, 0, 0)
Could you please check, if there's a mistake in my code?
Thanks Stefan
#10
Posted
:
Wednesday, January 31, 2007 11:59:16 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Please try to use the following code:
+-----------------------------------+
AxLEAD1.PaintSizeMode = LEADLib.PaintSizeModeConstants.PAINTSIZEMODE_FIT
AxLEAD2.PaintSizeMode = LEADLib.PaintSizeModeConstants.PAINTSIZEMODE_FIT
AxLEAD1.Load("c:\fax1.tif", 1, 1, 1)
AxLEAD2.CreateBitmap(AxLEAD1.InfoWidth, AxLEAD1.InfoHeight, 1)
AxLEAD1.CtlSize(AxLEAD1.BitmapWidth * 0.94, AxLEAD1.BitmapHeight * 0.94, 0)
AxLEAD2.Fill(System.UInt32.Parse("FFFFFF", Globalization.NumberStyles.HexNumber))
AxLEAD1.Combine((AxLEAD2.BitmapWidth - AxLEAD1.BitmapWidth) / 2, (AxLEAD2.BitmapHeight - AxLEAD1.BitmapHeight) / 2, AxLEAD1.BitmapWidth, AxLEAD1.BitmapHeight, AxLEAD1.Bitmap, 0, 0, LEADLib.CombineConstants.CB_OP_ADD And LEADLib.CombineConstants.CB_DST_0)
AxLEAD2.ForceRepaint()
AxLEAD2.AutoRepaint = True
AxLEAD1.Visible = True
+-----------------------------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#11
Posted
:
Thursday, February 1, 2007 4:23:31 AM(UTC)
Groups: Registered
Posts: 8
Hi,
i've found a mistake in your code
It must be AxLead2.combine(.......),
but after changing this, it worked great.
Thanks a lot!
Stefan
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.