Jump to content
A-man

savebitmap

Recommended Posts

When I use savebitmap() I can't find the file anywhere. I've double checked my path names and such, and I've tried saving it to different folders and I can't access it. Is it saved as a hidden file? Is it only accessible to scar? Can someone help me out? :)

Link to comment
Share on other sites

When I use savebitmap() I can't find the file anywhere. I've double checked my path names and such, and I've tried saving it to different folders and I can't access it. Is it saved as a hidden file? Is it only accessible to scar? Can someone help me out? :)

Sure, post your script, even if it doesn't work, or is just one line.

 

Try using for the path ScriptPath, or AppPath, etc.

Link to comment
Share on other sites

program New;

var

r, g, b, color, x, y, width, height, i, pic: Integer;

final_color, red, green, blue: T2DIntArray;

 

procedure rotate(pic: integer);

begin

for x := 0 to width-1 do

begin

for y := 0 to height-1 do

begin

final_color[x][y] := blue[x][y];

fastsetpixel(pic, x, y, final_color[x][y]);

end;

end;

savebitmap(pic, 'C:\Users\A-man\Pictures\SCAR Bitmaps\blank2.bmp');

end;

 

begin

cleardebug();

width := 64;

height := 64;

setlength(red, width);

setlength(green, width);

setlength(blue, width);

setlength(final_color, width);

for i := 0 to width-1 do

begin

setlength(red, height);

setlength(green, height);

setlength(blue, height);

setlength(final_color, height);

end;

pic := loadbitmap('C:\Users\A-man\Pictures\SCAR Bitmaps\blank.bmp');

for x := 0 to width-1 do

begin

for y := 0 to height-1 do

begin

colortorgb(fastgetpixel(pic, x, y), r, g, b);

red[x][y] := r;

green[x][y] := g;

blue[x][y] := b;

//green[x][y] := fastgetpixel(pic, x, y); //colortorgb

end;

end;

freebitmap(pic);

end.

 

---------- Post added at 07:42 AM ---------- Previous post was at 07:41 AM ----------

 

sorry, how do you do the codeboxes? that looks horrible. Anyways, this should load an image blank.bmp (which it does successfully), and save it as blank2.bmp.

Link to comment
Share on other sites

Oh man, *facepalm* haha, I'm working on a rotate function, it doesn't do anything except convert it to bluescale for testing purposes, but yeah, that would do it :P Thanks for using your eyes, unlike me :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...