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 : Thursday, June 15, 2006 8:35:23 PM(UTC)

ttg  
ttg

Groups: Registered
Posts: 2


Hello, I'm really hoping someone can give me a quick code fragment. I inheritied a VB6 application using LeadTools. I need to update to .Net long term, but for now I just have an emergency request to get the image records out of the database and into file format. They were saved with the following line in the VB6 app:

img.Save sFile, FILE_JFIF, 24, 2, 0

Here is a .Net skeleton I have for extracting the records. Could someone pretty please just fill in the sample code for me so I can help out quickly? Hopefully it can be done in just a few lines?

        Dim fname As String = "test.jpg"

        Dim dr As OleDbDataReader
        dr = returnDataReader("SELECT ID, Title, Image FROM Archive")
        Do While dr.Read
            'Save dr("Image") to file as fname
           
        Loop

If anyone can help me out I'd really appreciate it, thanks much!


 

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 : Monday, June 19, 2006 9:45:37 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 356


As far as the imaging part of your question is concerned, the way to save the image to disk file depends on how exactly it was stored in the database originally.
If the JFIF file (JPEG format) was stored complete as is, you need simply to dump the data to a disk file, and it will contain a valid JPEG image.

About doing it using OleDbDataReader, maybe the GetValue method with an ordinal value of 2 in your case might do it.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Monday, June 19, 2006 2:27:07 PM(UTC)

ttg  
ttg

Groups: Registered
Posts: 2


Akk! Thanks Amin. LOL, you should delete this stupid post. Someone had told me the images were in your proprietary format and I thought I needed to convert them. I just saved them as jpegs and they are fine. I should tried that first thing.
 
#4 Posted : Wednesday, June 21, 2006 5:38:49 PM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 356


Actually we do have a few proprietary image formats, such as CMP, CMW and LEAD ABC (which is VERY powerful in compressing black and white images), but JFIF (JPEG) is not one of them.

In the latest version of the toolkit, the constant names for different JPEG formats were changed to the more commonly used JPEG instead of JFIF.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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-2020, Yet Another Forum.NET
This page was generated in 0.218 seconds.