*FREE* Commandline Tool : AMSBitBlt

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • clueless
    Forum Member
    • Jun 2006
    • 421

    *FREE* Commandline Tool : AMSBitBlt

    Heres a new tool for you guys, its a wrapper for the BitBlt function available in C++ and Vb. AMSBiltBlt allows you to copy one bitmap inside another using boolean to merge the pixels and save it. Its very fast.

    I havent got a demo project for it yet as it still BETA.

    Its a commandline program so its an .exe file that has to have arguments passed to it to make it run.

    CommandLine Syntax:
    [SourceA.bmp/jpg/gif/png] [SourceB.bmp/jpg/gif/png] [Target.bmp] [cX] [cY] [cWidth] [cHeight] [TargetX] [TargetY] [BooleanBlendMethod]

    Usage
    SourceA : is the picture that gets written to.
    SourceB : is the picture that you can crop a section to write
    Bx,By : top left corner of the crop area
    cWidth,cHeight : dimentions of the area to be cropped
    TargetX,Y : where to place the cropped area into pic A

    Boolean Blend Method
    DstInvert - Inverts the destination rectangle.
    MergeCopy - Merges the colors of the source rectangle with the objects current brush using Boolean AND.
    MergePaint - Combines the inverted source bitmap with the destination bitmap by using Boolean OR.
    NotSrcCopy - Copies the inverted source bitmap to the destination bitmap.
    NotSrcErase - Inverts the result of combining the destination and source bitmaps by using OR
    PatCopy - Copies the objects current brush onto the destination bitmap
    PatInvert - Combines the destination bitmap with the objects current brush by using XOR
    PatPaint - Combines the inverted source bitmap with the objects current brush by using Or. It then Combines the result of this operation with the destination bitmap by using Boolean OR.
    SrcAnd - Combines the destination and source bitmaps by using Boolean AND
    SrcCopy - Copies the source bitmap to the destination bitmap.
    SrcErase - Inverts the destination bitmap and combines the result with the source bitmap using Boolean AND.
    SrcInvert - Combines the destination and source bitmaps by using Boolean XOR.
    SrcPaint - Combines the destination and source bitmaps by using Boolean OR.

    This prog has many uses, the BitBlt is used a lot by programs to alter background pictures of app's so controls can be moved about. Its also used to make skins for different sized windows. It can be used for putting together bar graphs or making scrolling backgrounds for games..
    have fun
    Download AMSBitBlt
  • Lorne
    Indigo Rose Staff Member
    • Feb 2001
    • 2729

    #2
    Neat, clueless.

    Since it's beta, I'll share a few friendly pointers.

    A better name for BooleanBlendMethod would be just BlendMethod, or follow the original API call and name it RasterOpCode or something. There isn't anything "boolean" about the blending done during the bit block transfer (well, perhaps on a 1-bit surface, but hopefully you know what I mean).

    Also, you seem to have mixed up the names of your parameters between your command line syntax and the descriptions that follow. Is it SourceA or Target? Is it cx,cy or Bx,By?

    You might want to use something more descriptive than cx,cy (which could be confused with the silly Microsoft nomenclature for width and height: "count of x, count of y").

    Using "crop" confuses the concept a little bit, too, I think.

    When I wrap BitBlt I usually use something like "destX,destY,width,height,sourceX,sourceY"...

    --[[ Indigo Rose Software Developer ]]

    Comment

    • clueless
      Forum Member
      • Jun 2006
      • 421

      #3
      Ahh thats what dwRop stands for . lol. I did wonder..
      The variable names are to short to be descriptive, i was trying to keep the length of the command line down so it didnt put people off using it, but your right its probably better the other way around.
      Ill make some sort of demo to test it out.

      Comment

      • rexzooly
        No longer a forum member
        • Jul 2007
        • 1512

        #4
        ok run i get Runtime Error "9" Subscrpits out of range this in on my windows XP sp2 system.

        Comment

        • clueless
          Forum Member
          • Jun 2006
          • 421

          #5
          hmm i just tested it with the commandline:
          c:\A.bmp c:\B.bmp c:\C.bmp 10 10 250 250 50 50 SrcCopy
          and it worked ok. Ill build a small demo to see if theres any problem.

          Comment

          • rexzooly
            No longer a forum member
            • Jul 2007
            • 1512

            #6
            Tested it on 2 systems same error so its not just my older computer

            Comment

            • clueless
              Forum Member
              • Jun 2006
              • 421

              #7
              I'm pretty sure its working OK.. mainly because the only time i use arrays is once at the start to split-up the commandline.
              Code:
              cline = Split(Command$, " ")
              fNameA = cline(0)
              fNameB = cline(1)
              fTarget = cline(2)
              Ax = Val(cline(3))
              Ay = Val(cline(4))
              Aw = Val(cline(5))
              Ah = Val(cline(6))
              Bx = Val(cline(7))
              By = Val(cline(8))
              If cline(9) =
              and that's it .. no more array operations . As there's no cLine(10) if you use the commandline i posted above that has 10 arguments you shouldntt get a subscript error .. you would be more likely to have something like a 'type mismatch error' if a string was used for a number or vice versa.

              Comment

              • rexzooly
                No longer a forum member
                • Jul 2007
                • 1512

                #8
                really busy with WinTexOS but i will re-test tomorrow

                Comment

                Working...
                X