1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Crop from one bitmap into another without drawing on screen

Discussion in 'Win32' started by Tekri, Sep 20, 2006.

  1. Tekri

    Tekri New Member

    Joined:
    Sep 20, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I have some bitmap on disk, which is monochrome. I need code sequence for crop some portion of this bitmap to memory. I'm don't need show bitmap on screen; I'm using VPascal and I'm limited to basic GDI (not gdi+).
    I try this for few days, but now I'm totaly confused.

    code maybe begin ...

    char * buffer;
    handle picture;
    long left,top,width,height;

    left=20;top=30;width=300;height=100;
    buffer = malloc((width-left)*(height-top) /8);
    picture= LoadImage(0,'picture.bmp,image_bitmap,0,0,LR_LOADFROMFILE |
    LR_CREATEDIBSECTION);
    ...
    ...
    ...

    Can someone explain rest of code or ...

    thanks for advice
     
  2. johny10151981

    johny10151981 New Member

    Joined:
    Jul 7, 2010
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    number1: use CreateCompatibleDC to create a memory device context.
    then use BitBlt to copy your specifiq portion from source to newly created compatible DC. I think this will help you.
     
  3. crazy_awper

    crazy_awper New Member

    Joined:
    Jan 16, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    It is great,your opinion is very novelty thanks very much guy!.
     

Share This Page