Results 1 to 6 of 6

Thread: PaintSmart additions

  1. #1
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default PaintSmart additions

    I feel awkward leaving my name in there, I made these functions for another project, and figured people wouldn't mind having them as well? You can remove my name from the credits if you want since they're one line procedures AND the procedure inside isn't really mine. I just cut and pasted it from my other thing for quickness. Sorry.

    Reason I'm proposing this addition:
    You can't find these commands in the include menu. In fact, I searched honestly high and low and struggled to find these. IIRC from my past experience I couldn't find them anywhere on the forums because you need to know the function name (SmartSetDebug...) to search it unless you can guess it with some luck. If it wasn't for RM, I'd never have found them.
    This would allow people unfamiliar with it to be able to start using paint. It's an awesome tool.

    If they're already in the include, lock/delete please. Thanks.
    Simba Code:
    {*******************************************************************************
    procedure SMART_EnableSmartCanvas;
    by: Cstrike
    Description: Enables canvas for drawing on.
    *******************************************************************************}

    procedure SMART_EnableSmartCanvas;
    begin
      SmartSetDebug(true);
    end;

    {*******************************************************************************
    procedure SMART_DisableSmartCanvas;
    by: Cstrike
    Description: Disables canvas.
    *******************************************************************************}

    procedure SMART_DisableSmartCanvas;
    begin
      SmartSetDebug(false);
    end;

    {*******************************************************************************
    procedure SMART_ClearSmartCanvas;
    by: Cstrike
    Description: Clears canvas.
    *******************************************************************************}

    procedure SMART_ClearSmartCanvas;
    begin
      SMART_DrawTextEx(true, 1, 1, StatChars, ' ', clRed);
    end;
    The last one would need to be placed after SMART_DrawTextEx or something like that, or find another way to free the canvas other than my crap method. I really suck with canvases though.

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    http://villavu.com/forum/showthread....g+smart+canvas

    They showed you a better method in this thread :S

    Edit: http://villavu.com/forum/showpost.ph...62&postcount=4
    another one ^

  3. #3
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Then... obviously the answer is now

    Simba Code:
    {*******************************************************************************
    procedure SMART_ClearSmartCanvas;
    by: Shuttleu
    Description: Clears canvas.
    *******************************************************************************}

    procedure SMART_ClearSmartCanvas;
    begin
    var
      drawing : TBitmap;
    begin
      drawing := TBitmap.Create;
      drawing.canvas.handle := SmartGetDebugDC;

      ClearRSCanvas(drawing.canvas);

      try
        FreeBitmap(drawing);
      except end;
    end;

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by cstrike View Post
    Then... obviously the answer is now

    Simba Code:
    {*******************************************************************************
    procedure SMART_ClearSmartCanvas;
    by: Shuttleu
    Description: Clears canvas.
    *******************************************************************************}

    procedure SMART_ClearSmartCanvas;
    begin
    var
      drawing : TBitmap;
    begin
      drawing := TBitmap.Create;
      drawing.canvas.handle := SmartGetDebugDC;

      ClearRSCanvas(drawing.canvas);

      try
        FreeBitmap(drawing);
      except end;
    end;
    me likey!

  5. #5
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Stuck it so I don't lose track of the thread

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  6. #6
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Paintsmart is uber beautiful, I would pay for this to be committed
    Plus mormonman's update is better than mine, and can be thrown at the start.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •