| |

VerySource

 Forgot password?
 Register
Search
View: 816|Reply: 3

imageXpress similar function to separate an RGB image into three images of three colors R, G and B and save it to the sp

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-31 11:40:01
| Show all posts |Read mode
imageXpress has a similar function, which separates an RGB image into three images of R, G, and B colors and saves them to a specified path. imageXpress.dll only supports VB / Deliph? Are there similar components? Requires fast.
Reply

Use magic Report

0

Threads

16

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-3-14 16:15:01
| Show all posts
Scan with scanline and get 3 tbitmaps. It's not bad. The speed is good.
This dll has never been used
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-18 03:45:01
| Show all posts
Graphics :: TBitmap * pBitmap = new Graphics :: TBitmap ();
// This example shows drawing directly to the Bitmap
  Byte * ptr;
  try
  {
    pBitmap-> LoadFromFile ("d:\\temp.bmp");
    for (int y = 0; y <pBitmap-> Height; y ++)
    {
      ptr = (Byte *) pBitmap-> ScanLine [y];
      for (int x = 0; x <pBitmap-> Width; x ++)

        ptr [x] = (Byte) y;
    }
    Canvas-> Draw (0,0, pBitmap);
  }
  catch (...)
  {
    ShowMessage ("Could not load or alter bitmap");
  }
  delete pBitmap;



This is an example in the help. I took the test and ran it. It prompts "Gdi.dll" error. Do I have to load any files? In addition, how do the separated pixels read out form a Bmp file? Thanks "Angel"!
Reply

Use magic Report

0

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-6-14 00:00:01
| Show all posts
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    Graphics::TBitmap *bmpR=new Graphics::TBitmap;
    Graphics::TBitmap *bmpG=new Graphics::TBitmap;
    Graphics::TBitmap *bmpB=new Graphics::TBitmap;
    bmpR->LoadFromFile("C:\\test.bmp");
    bmpR->PixelFormat=pf24bit; //Set to 24-bit color (easy to change, huh)
    bmpG->Assign(bmpR); // same as bmpR
    bmpB->Assign(bmpR);

    Byte *ptrR, *ptrG, *ptrB;
    for (int y = 0; y <bmpR->Height; y++)
    {
      ptrR = (Byte *)bmpR->ScanLine[y]; //Pixel color sequence of each line
      ptrG = (Byte *)bmpG->ScanLine[y];
      ptrB = (Byte *)bmpB->ScanLine[y];
      for (int x = 0; x <bmpR->Width; x++) //For 24Bit pictures, each pixel occupies three bits
      {
        ptrB[x*3+1] = 0; //Remove the green component
        ptrB[x*3+2] = 0; //Remove the red component and leave the blue one

        ptrG[x*3] = 0; //Remove the blue and red components, leaving the green
        ptrG[x*3+2] = 0;

        ptrR[x*3] = 0; // Same as above
        ptrR[x*3+1] = 0;
      }
    }
    bmpR->SaveToFile("C:\\R.bmp"); //Save
    bmpG->SaveToFile("C:\\G.bmp");
    bmpB->SaveToFile("C:\\B.bmp");
    delete bmpR;
    delete bmpG;
    delete bmpB;
}
The BCB6.0 test passed, and the merger is similar, just change it.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list