convert multipage tif image into seperate files


    Sponsored Links


  • 1. Webcam frame to array
    Hi. I've been banging my head against a wall over this, and it's probably simple. I'd like to be able to grab frames from a webcam (24 bit RGB) and dump the data into a VB6 array *without* either saving the file to disk or copying it to the clipboard. I can do it those ways, using Ray Mercer's (really neat) ezVidCap. The goal is to be able to process the frames without chewing up the hard disk constantly and without blocking other programs from using the clipboard, which is my current method. I've tried a few different things: Found some code using the avicap dll that puts the image in a picturebox. I thought I could use CopyMemory in kernel32 to dump that into an array. No luck, but lots of crashes. I tried using the window handle, using an objptr to the picture box, etc. Also tried (just to check) pixel-by-pixel copying of the webcam box to a blank picture box, but it just turned white. That may have something to do with hardware acceleration, as I understand it. I've recently downloaded vbVidCap (again from Ray Mercer's site), and it looks more promising, but I still can't really figure out what it would take to put the pixel data into an array. I've googled for all I'm worth, but it's not happening. TIA for any suggestions.
  • 2. Polygon rendering speed
    I think I've optimized my code as best as possible, but thought I'd double check with the experts. I'm rendering weather radar data on a device context, with the following specs. Data consists of 4 sided polygons, of which a single bitmap could contain around 140,000 polygons that average about 2x2 pixels in size. Each polygon could have a different color, so a selectobject brush/pen call it appears in each iteration over the 140,000 polygons The underlying logic is as follows For each polar azimuth '0 to 360 degrees For each bin along that azimuth '0 to 400 deep If value is not 0 then Calculate poly(0 to 3).X, and poly(0 to 3).Y Select pen/brush based on value of bin polygon layer.hdc, poly(0), 4 End If Next bin Next azimuth The execution of this code obviously depends on the amount of non-zero data, but for an average dataset, a single image takes 0.5 to 0.7 seconds on a fairly high end PC. This should seem fast enough, but with the data constantly being updated and redrawn through panning/zooming/new would be nice to get this as absolutely fast as possible. Anything I can look at or am I already maxed out? TIA, Evan
  • 3. Trending/Graph examples
    Hello all, Am reletively new to VB.NET and was wondering if anyone knows of anywhere that has free samples/examples of creating trends/graphs using VB.NET 2005? Apologies if this is the wrong forum... Thanks, Damian
  • 4. Build time resizing of ActiveX controls
    Hi All, We have our own ActiveX controls inside which there is some buttons,trend funtionalities etc. When i am trying to use the same control in some other application i observe that i cannot resize that control. Afterward i found that the functionality is not there toresize the control. Can anybody suggest me how can i add the functionality in my ActiveX control so that i can resize it whenever i am using the control in any other application. I need to know both runtime and build time resize information. I am working in VS2005. Thanks to all

convert multipage tif image into seperate files

Postby VG9tIEY » Wed, 12 Jan 2005 09:33:02 GMT

I am looking to scan a large amout of documents. I believe I will end up with 
a bunch of documents that contain 30-50 pages. They will come from the 
scanner as  large tif files. I would like to break them up into a tif file 
for each page. I'm pretty good with VB and would like to use it to automate 
this task if possible. I looked on google and can't find anything. I'm sure 
it's out there but I think I'm not picking good key words. Can someone give 
me a hint on that?


RE: convert multipage tif image into seperate files

Postby VG9tIEY » Thu, 13 Jan 2005 06:37:01 GMT

I figured it out. It isn't very elegent though. I basically open the tif 
using the MODICtl that is available if you have office 2003 installed. Then I 
systemitacally delete every image on the page except for one and then save 
that as that page#.tif. In case you hadn't figured it out, all the pages I've 
scanned have the page # listed on the bottom. That makes them be the last 
word on the document. Below is a snippet of code that may be useful to 

Set miDoc = New MODICtl.Document
 Dim breakUp, m, n, pre, post
 numberofPagesButton = True
 For n = 0 To numberofPages - 1
     miDoc.Create "C:\01.tif"
          For pre = 0 To n - 1
          miDoc.Images.Remove miDoc.Images(0)
          Next pre
          numberofPages = miDoc.Images.Count
          For post = 1 To numberofPages - 1
          miDoc.Images.Remove miDoc.Images(1)
          Next post
          ' miLayout.NumWords  miLayout.Words(0).Text
        Set miLayout = miDoc.Images(0).Layout
        miDoc.SaveAs "C:\" & miLayout.Words(miLayout.NumWords - 1).Text & 

    Next n
Set miDoc = Nothing

Similar Threads:

1.GDI+ Imaging: multipage TIF

Is there a way to page through a multipage TIF when using 
the bmp.fromfile() and gr.drawimage() techniques?

2.Setting the compression when creating the multipage Tif files in

I was successful in creating the multipage Tif files in using
the following the following code:

   Public Sub SaveSeveralOnePageFilesInADir(ByVal DrNm As String, ByVal

resultFl As String)

        Dim pages As Bitmap = Nothing
        Dim PgCnt As Integer
        Dim ix As Integer

        Dim fl As String

        If Dir$(resultFl) <> "" Then
        End If


        Dim enc As System.Drawing.Imaging.Encoder =

                Dim info As System.Drawing.Imaging.ImageCodecInfo =

        For Each ice As System.Drawing.Imaging.ImageCodecInfo In

            If ice.MimeType = "image/tiff" Then

                info = ice

            End If


                Dim ep As System.Drawing.Imaging.EncoderParameters =
New System.Drawing.Imaging.EncoderParameters(1)

        fl = Dir$(DrNm + "\*.*", FileAttribute.Normal +
        ix = 0
        Do While fl <> ""
            fl = UCase$(fl)
            If InStr(fl, ".JPG") <> 0 Or InStr(fl, ".GIF") <> 0 Then
                ix = ix + 1
                fl = DrNm + "\" + fl
                If ix = 1 Then

                    ep.Param(0) = New
CType(System.Drawing.Imaging.EncoderValue.MultiFrame, Long))

                    pages = Image.FromFile(fl)
                    pages.Save(resultFl, info, ep)
                                        ep.Param(0) = New
CType(System.Drawing.Imaging.EncoderValue.FrameDimensionPage, Long))

                    Dim bm As Bitmap = Image.FromFile(fl)
                    pages.SaveAdd(bm, ep)
                End If
            End If
            fl = Dir$()

               ep.Param(0) = New
CType(System.Drawing.Imaging.EncoderValue.Flush, Long))


    End Sub

My big problem now is that I was not able to find information on how I
also set the compression that I need for the pages of those multipage
files. For example, for the black and white images in a multipage Tiff
the compression should be CCITT4, and, for the color images in a
Tif file, the compression should be JPEG medium compression with the
resolution. How can it be accomplished?

Thank you very much. 

Irene S.

3.Convert image tif to bmp

4.Using MODI to convert multi-page tif to single page tif

I have thousands of multipage tif images in many subdirectories that I need 
to convert into single page tifs.  I have vba code to do this (written in MS 
Access) that loops thru the directory tree and I can access info about the 
tifs using MODI.  What I'm looking to do now is convert/save the existing 
multiple page tif to a series of single page tifs so they can be imported 
into our image repository.  Anyone know how to do this?  For example, if the 
current multiple page tif is six pages is would create six single page tifs 
(e.g. sample1_page1.tif,sample1_page2.tif,...


5.Convert multiple .rtf files to .tif files

I have a whole bunch of .rtf files that I want to convert to .tif
files for archiving purposes.

Is it possible to "convert" each of the .rtf files to .tif files using
the Microsoft Office Document Image Writer without opening up an
instance of MS Word? I'd like to do a "background" conversion (because
there are so many files).

The user would launch the application and select the source directory
where all the .rtf files are stored. Then the user clicks a "Convert"
button and the files in the directory that the user specifies are
converted to .tiff in the background.

Can this be done, or do I have to use an instance of MS Word in the

6. join two tif files to one tif file

7. using Xsane to convert multipage document to single pdf file

8. Problem with ImageMigick Convert and a multipage pdf file

Return to graphics


Who is online

Users browsing this forum: No registered users and 91 guest