Example #1
0
        private ReturnValues SendImageToFip(uint page, Bitmap fipImage)
        {
            if (_initOk)
            {
                if (fipImage == null)
                {
                    return(ReturnValues.E_INVALIDARG);
                }

                try
                {
                    fipImage.RotateFlip(RotateFlipType.Rotate180FlipX);

                    var bitmapData =
                        fipImage.LockBits(new Rectangle(0, 0, fipImage.Width, fipImage.Height),
                                          ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
                    var intPtr = bitmapData.Scan0;
                    var local3 = bitmapData.Stride * fipImage.Height;
                    DirectOutputClass.SetImage(FipDevicePointer, page, 0, local3, intPtr);
                    fipImage.UnlockBits(bitmapData);
                    return(ReturnValues.S_OK);
                }
                catch (Exception ex)
                {
                    App.Log.Error(ex);
                }
            }

            return(ReturnValues.E_FAIL);
        }