Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, June 17, 2012 11:12:40 PM(UTC)
bnvelarde

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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, June 17, 2012 11:59:22 PM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 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:54:02 PM(UTC)
bnvelarde

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:59:13 AM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 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:26:04 PM(UTC)
bnvelarde

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:49:53 PM(UTC)
bnvelarde

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.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.142 seconds.