TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Inverted red and blue colors in memory transfer mode

Forums › TWAIN Classic › Inverted red and blue colors in memory transfer mode

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 10 months ago by biswajitbiee.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 25, 2012 at 10:53 am #22734 Reply
    sunshine_ak
    Participant
    • Topics - 7
    • Replies - 4
    • Total Posts - 11

    Image received by memory transfer mode has red color replaced with blue and vice versa. I tried to invert them using macro

    #define RGB2BGR(color) (color & 0xFF000000) | ((color & 0xFF0000) >> 16) | (color & 0x00FF00) | ((color & 0x0000FF) << 16)

    but the image wasn’t correct. Did anyone had similar problem? How to invert colors?



    If this could help to somebody, in Twacker source code is a function named FlipBitMap. I didn’t know that native and memory mode have different colors order.

    March 10, 2012 at 8:20 am #25551 Reply
    biswajitbiee
    Participant
    • Topics - 1
    • Replies - 1
    • Total Posts - 2

    Hi,

    In memory mode data transfer actually the pixel format coming from DS is BGR, so in the application you need to flip the R and B of every pixel to make it RGB.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Inverted red and blue colors in memory transfer mode
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • Girls of Desire: All babes in one place, crazy, art
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.