This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, June 17, 2012 11:07:40 PM(UTC)
Groups: Registered
Posts: 34
Hi, why is it that the only image I can load is .jpeg? Is there something wrong in my code?
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
Using dlg As New OpenFileDialog()
dlg.Filter = "All Files|*.*"
If dlg.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK Then
LoadImage(dlg.FileName)
End If
End Using
End Sub
Private Sub LoadImage(ByVal fileName As String)
If Not IsNothing(fileName) Then
Try
Using codecs As New RasterCodecs()
_storeImage = codecs.Load(fileName)
Dim command As GrayscaleCommand = New GrayscaleCommand(8)
Command.Run(_storeImage)
backToNormal()
End Using
Catch ex As Exception
Return
End Try
End If
_rasterImage.Image = _storeImage.Clone
End Sub
I also want to create a new file extension (format) when I save an image, is that possible with leadtools?
Im using vb.net 2010 and leadtools 17.5
#2
Posted
:
Sunday, June 17, 2012 11:54:22 PM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The problem might be related to missing DLLs. For example, to load BMP images, you need to add the Leadtools.Codecs.Bmp.dll DLL as a reference to your project. Also, to load TIF images, you need to add the Leadtools.Codecs.Tif.dll DLL as a reference to your project.
For more information, please see the help topic "Files To Be Included With Your Application" in the LEADTOOLS .Net documentation or refer to the following online help topic:
http://www.leadtools.com/help/leadtools/v175/dh/to/leadtools.topics~leadtools.topics.filestobeincludedwithyourapplication.html
About saving an image, you need to use the Codecs.Save() Method. In this method, you can save a raster image into a file, a stream or a remote URL in any of the supported compressed or uncompressed formats.
For more information, please see the help topic "Save Method" in the LEADTOOLS .Net documentation or refer to the following online help topic:
http://www.leadtools.com/help/leadtools/v175/dh/co/leadtools.codecs~leadtools.codecs.rastercodecs~save.html
#3
Posted
:
Monday, June 18, 2012 10:49:02 PM(UTC)
Groups: Registered
Posts: 34
Ow, silly me.
How about in saving an image? I want to create a new file format, say for example .sef. iI it possible in leadtools?
Thanks a lot.
#4
Posted
:
Tuesday, June 19, 2012 12:54:13 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
As a name, you can save the file name to any name you want. However, you must specify the format of the image as one of our supported format when saving it using the codecs.save() method.
There are hundreds of image formats that LEADTOOLS support. Please see the following page to know the image formats that our toolkit supports:
http://www.leadtools.com/sdk/formats/image-formats.htm
#5
Posted
:
Tuesday, June 19, 2012 10:21:04 PM(UTC)
Groups: Registered
Posts: 34
What my boss wants is that we will generate our own new file format when saving a picture.
#6
Posted
:
Tuesday, June 19, 2012 11:44:53 PM(UTC)
Groups: Registered
Posts: 34
Nevermind, i solved it already.
Thanks a lot :)
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.