Results 1 to 7 of 7

Thread: Canvas / bitmap help

  1. #1
    Join Date
    Feb 2006
    Location
    gmail messnger--evilkukka@gmail.com
    Posts
    272
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Canvas / bitmap help

    I need to find a way to :
    • draw a bitmap/canvas image on another canvas image
    • make a canvas image have transparency support
    • merge bitmaps together
    • convert canvas to bitmap

    Any ideas?
    <SmarterC> mixster: The only reason so many people are homosexuals

  2. #2
    Join Date
    Oct 2007
    Posts
    678
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im a little lost on what u want but maybe (prbly not) you could set 1 as a desktop background and the other one open in a window then go 2 invida options to trancparency and when you got it the way u want press prn scr? lol im crazy...if this is wat u wanted? i duno im lost!

  3. #3
    Join Date
    Feb 2006
    Location
    gmail messnger--evilkukka@gmail.com
    Posts
    272
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, I'm trying to render text on a canvas image (drawing on tiles,meaning the text bitmapo must be split into pieces in order to get ouputted properly, which would then be displayed on the canvas)
    <SmarterC> mixster: The only reason so many people are homosexuals

  4. #4
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    I think theres a "DrawText" or something that can draw a bitmap, I can tell you the Text->Bitmap if you want.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  5. #5
    Join Date
    Feb 2006
    Location
    gmail messnger--evilkukka@gmail.com
    Posts
    272
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure SliceBitmap(bitmap,locx,locy:integer);
    var x,y,width,height,CurrentX,xcounter:integer;

    begin
      GetBitmapSize(bitmap,width,height);
      SetTransparentColor(bitmap,clblack)
      writeln('Width:'+IntToSTr(width)+'Height:'+IntToSTr(Height));
      y:=0;
      repeat
        begin
          x:=0;
          repeat
            CurrentX:=x;
            XCounter:=x/tilewidth
            writeln('X:' +IntToStr(CurrentX)+'/'+IntToStr(width));
            if x>TileWidth*XCounter then
            begin
            FastSetPixel(Text_Layer[whichtiles(locx+x,locy+y)+1], x, y ,FastGetPixel(bitmap,x,y))
            LoadSingleTile(whichtiles(locx+x,locy+y)+1)
            end else
            FastSetPixel(Text_Layer[whichtiles(locx+x,locy+y)], x, y ,FastGetPixel(bitmap,x,y));

            X:=x+1;
          until(X=Width+1)
        end;
        writeLn('started freshpixelcolumn":'+ IntToStr(y)+'/'+IntToStr(height));
       y:=y+1;
       until(y=height+1)
    end;

    procedure CanvasText(text:string; x,y:integer);
    var a,tempbmp,bmpwidth,bmpheight,tileresult,totalwidth,totalheight:integer;
    BitmapCropCanvas,BitmapCropCanvas2:TCanvas;
    begin
      tempbmp:=CreateBitmapMaskFromText( text, UpChars);

      GetBitmapSize( tempbmp, bmpwidth, bmpheight);
      totalWidth:=bmpwidth/TileWidth;
      if(bmpwidth mod TileWidth <> 0)then totalWidth:=totalWidth+1;
      totalHeight:=bmpheight/TileHeight;
      if(bmpheight mod TileHeight <> 0)then totalHeight:=totalHeight+1;

      TileResult:=whichtiles( x, y)
      Writeln( IntToStr( TileResult));
     {Text_Layer[whichtiles( x, y)]:=tempbmp; }
      SliceBitmap(tempbmp,x,y);
     { LoadSingleTile(whichtiles(x,y));
      if(not(totalwidth=1))then
      begin
        for a:=1 to totalwidth-1 do
          begin
            LoadSingleTile(whichtiles(x,y)+a);
          end;
      end;
      if(not(totalHeight=1))then
      begin
        for a:=1 to totalHeight-1 do
          begin
            LoadSingleTile(whichtiles(x,y)+(a*16));
          end;
      end;      }



    end;


    the output of: CanvasText('20...21',100,40); is this:


    The transparency has gone,and the part of the text bitmap on the second tile seemed to have been copied from the first one..
    Any ideas?
    <SmarterC> mixster: The only reason so many people are homosexuals

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Canvas.TextOut can be used for text.
    I can't really help you with the transparency though.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  7. #7
    Join Date
    Feb 2006
    Location
    gmail messnger--evilkukka@gmail.com
    Posts
    272
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how can I use this Canvas.textOut feature?
    <SmarterC> mixster: The only reason so many people are homosexuals

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Canvas Help.
    By skilld u in forum OSR Help
    Replies: 3
    Last Post: 07-10-2008, 09:18 PM
  2. Canvas
    By Negaal in forum OSR Help
    Replies: 7
    Last Post: 01-30-2008, 05:57 PM
  3. canvas
    By ~~Amur~~ in forum OSR Help
    Replies: 7
    Last Post: 01-02-2008, 06:05 PM
  4. Find Bitmap in Bitmap file
    By fORCE_wORKS in forum RS3 Outdated / Broken Scripts
    Replies: 8
    Last Post: 12-13-2007, 11:04 PM
  5. convert canvas to bitmap
    By sherlockmeister in forum OSR Help
    Replies: 4
    Last Post: 08-07-2007, 03:48 PM

Posting Permissions

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