This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Unable to Copy 1bppIndexed to New 1bppIndexed?

It seems when I use the code below with the first red entry listed as 1bppIndexed, and the second red entry ommitted, the resulting image is all black.

If I add the red entries, the resulting image comes out fine, but I'm simply trying to copy a portion of a 1bppIndexed (ccitt4 compressed TIFF image) to a new file, and the conversion from 1bpp to 24bRgb and then back again is adding quite a delay to the process.

Am I missing something here? Or is copying from 1bppIndexed to a new 1bppIndex bitmap not supported?
        Dim bmpSource As New Aurigma.GraphicsMill.Bitmap
        Dim bmpDest As Aurigma.GraphicsMill.Bitmap


            
        Dim tifReader As New Aurigma.GraphicsMill.Codecs.TiffReader(strOldFileName)

            

        tifReader.Open(strOldFileName)

            
        With tifReader.LoadFrame(0)
            .GetBitmap(bmpSource)

            Dim rctSource As Rectangle = GetSourceRect()
            
            bmpDest = New Aurigma.GraphicsMill.Bitmap(Aurigma.GraphicsMill.RgbColor.White, .Width, rctSource.Height, PixelFormat.Format24bppRgb)

            bmpSource.Draw(bmpDest, New Rectangle(0, 0, 0, 0), rctSource, Transforms.CombineMode.Copy, 0, Transforms.InterpolationMode.HighSpeed)
        End With

            
        bmpDest.ColorManagement.Convert(PixelFormat.Format1bppIndexed)
        bmpDest.Save(strNewFileName, New Codecs.TiffEncoderOptions(Codecs.CompressionType.Ccitt4))
       
        bmpSource.Dispose()
        bmpDest.Dispose()
Hello,

Which version of the GraphicsMill for .NET do you use? I've tried to draw 1bppIndexed on another 1bppIndexed bitmap - it works fine with current version 4.0 of the library. Please download the latest version and try it out.
I have version 3.1, but I tried it in version 4.0 and it seemed to work. Is there an update available to make this work in 3.1?
Hello,

You can upgrade your Graphics Mill 3.1 for .NET to Graphics Mill 4.0 for .NET. More information you can read in the Graphics Mill for .NET section of our site.