Results 1 to 2 of 2

Thread: Bitmap Handling Mini-problem

  1. #1
    Join Date
    Feb 2006
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bitmap Handling Mini-problem

    Here's my problem. I want to make a tidbit in my script where it loads a bitmap, draws a rectangle at a specific point, and saves it. Here's what I have so far:

    Code:
    intTempBitmap := LoadBitmap('TEMP.BMP');
    MarkingCanvas:=GetBitmapCanvas(intTempBitmap);
    MarkingCanvas.Brush.Color := 16777215;
    MarkingCanvas.Pen.Color := 16777215;
    MarkingCanvas.Rectangle(5,5,7,7);
    strPath := '../Folder/screenshot.bmp';
    SaveBitmap(intTempBitmap,strPath);
    CopyCanvas(MarkingCanvas,DebugCanvas,0,0,765,505,0,0,765,505);
    MarkingCanvas.Free;
    FreeBitmap(intTempBitmap);
    All variables are defined. This isn't a problem with the coding structure. It just gives me a runtime error.

    Help please?

    PS. The files are all there, and are loaded properly. I checked.

  2. #2
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I wrote one and it works for me..

    Code:
    var C, Debug: TCanvas;
    var T, Load, Load2: Integer;
    
    begin
      Load:= OpenFile(AppPath + 'V2.bmp', true);
      Load2:= OpenFile(AppPath + 'V.bmp', true);
      ClearDebug;
      if (Load > -1) or (Load2 = -1) then
      begin
        if (Load > -1) then
        begin
          Writeln('Please Delete V2.bmp To Continue.');
          Writeln('Found: ' + AppPath + 'V2.bmp');
          Writeln(' ');
        end;
        if (Load2 = -1) then
        begin
          Writeln('Please Create V.bmp To Continue.');
          Writeln(' ');
        end;
        TerminateScript;
      end;
      T:= LoadBitmap(AppPath + 'V.bmp');
      C:= GetBitmapCanvas(T);
      C.Rectangle(5, 5, 300, 300);
      SaveBitmap(T, Apppath + 'V2.bmp');
      DisplayDebugImgWindow(305, 305);
      Debug:= GetDebugCanvas;
      CopyCanvas(C, Debug, 0, 0, 305, 305, 0, 0, 305, 305);
    end.
    ;\

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Bitmap problem
    By Pauwelke in forum OSR Help
    Replies: 5
    Last Post: 06-08-2008, 04:56 PM
  2. Bitmap problem
    By Pietpatat in forum OSR Help
    Replies: 3
    Last Post: 02-12-2008, 04:58 PM
  3. Problem with Bitmap
    By Supersepi in forum OSR Help
    Replies: 15
    Last Post: 10-02-2007, 07:20 PM
  4. Bitmap Problem
    By Kingofptw in forum OSR Help
    Replies: 5
    Last Post: 03-22-2007, 01:43 AM
  5. Multiple Bitmap problem
    By extreme300 in forum OSR Help
    Replies: 3
    Last Post: 02-25-2007, 01:20 AM

Posting Permissions

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