shadowrecon Posted May 30, 2012 Share Posted May 30, 2012 (edited) This function was made for SPS since Scar doesn't have the ability to re-size bitmaps with TBitmaps. I dont know if it is the 'best' way but it does work. [scar] // Author: ShadowRecon // Makes Bitmap Larger, without loosing orginal image. // Wish there was a more effiecnt way of doing this.. Procedure SetBMPSize(Var BMP: {$IFNDEF SCAR335_UP} Integer {$ELSE} TSCARBitmap {$ENDIF}; Const nWi,nHe: Integer); Var tempBMP: {$IFNDEF SCAR335_UP} Integer {$ELSE} TSCARBitmap {$ENDIF}; Begin tempBMP := BMP; {$IFNDEF SCAR335_UP} BMP := BitmapFromString(nWi,nHe,''); FastDrawTransparent(0,0,tempBMP, BMP); FreeBitmap(tempBMP); {$ELSE} BMP := TSCARBitmap.Create(''); BMP.SetSize(nWi, nHe); tempBMP.DrawTo(BMP, 0, 0); tempBMP.Free; {$ENDIF} end; [/scar] Edited July 17, 2012 by shadowrecon Quote Link to comment Share on other sites More sharing options...
FHannes Posted May 30, 2012 Share Posted May 30, 2012 I don't really understand why you can't use [wiki=ResizeBitmap]ResizeBitmap[/wiki]. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted May 30, 2012 Author Share Posted May 30, 2012 (edited) I don't really understand why you can't use [wiki=ResizeBitmap]ResizeBitmap[/wiki]. Because im resizing the bitmap canvas not the actual bitmap. Creating blank space. That function actually changes the size of the bitmap. This keeps the original size, and adds black space to the bitmaps canvas. This was used for Putting the map pieces together into one big map. That is why i cant use that function, better understand? Edited May 30, 2012 by shadowrecon Quote Link to comment Share on other sites More sharing options...
FHannes Posted May 30, 2012 Share Posted May 30, 2012 Yes, I get it now, I guess I wasn't paying much attention to the actual code you posted I should probably add a function to resize the canvas to SCAR, but when I do so I'll probably add a parameter to anchor the bitmap in a certain position, like you can do when resizing the canvas in photo editing software. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted May 30, 2012 Author Share Posted May 30, 2012 Yes, I get it now, I guess I wasn't paying much attention to the actual code you posted I should probably add a function to resize the canvas to SCAR, but when I do so I'll probably add a parameter to anchor the bitmap in a certain position, like you can do when resizing the canvas in photo editing software. A actual function within scar would be pretty sweet, not to include a lot faster im sure! This function can be a bit slow when using large bitmaps (500x500) but it works. Quote Link to comment Share on other sites More sharing options...
TerryKig Posted July 17 Share Posted July 17 pete koomen bitcoin customer service number usa accept crypto payments api what is hex crypto buy bitcoin walmart bounce token crypto ignition key bear in bear trap what is the difference between the primary and secondary market buy bitcoin giftcards assassin creed mirage excavation site best crypto tracker website is tensor crypto a good investment 5000 us dollars to bitcoin is gemini safe to buy bitcoin .009 bitcoin aiat 1.01 bitcoin satoshis cryptocurrency portfolio app buy bitcoin anonymously 2020 0 01 bitcoin mcdonald's crypto aweave anonymous crypto credit card buy bitcoin 40x buy bitcoin and send to waller does krogers take apple pay how many bitcoin left to buy aem crypto-support how to join a private telegram beat place to buy bitcoin bow to buy bitcoin can't buy bitcoin robinhood what is crypto 2.0 how to buy into bitcoin mining alexis ohanian bitcoin 51 attack on bitcoin north rock capital can you buy bitcoin at a bitcoin atm tifa censored buy bitcoin with checking account card buy bitcoin credit card can you buy bitcoin with a prepaid car alan greenspan cnbc bitcoin buy bitcoin with bank account usa can you buy bitcoin schwab a bitcoin believer's crisis of faith xrpchart 10 000 bitcoin in dollars jet token stock Quote Link to comment Share on other sites More sharing options...