> Am 04.01.2018 um 19:27 schrieb Julia Truchsess <ju...@pragmaticdesigns.com>:
> 
> I’m trying to scale a PNG using pictureMBS.scale. The scaling looks nice but 
> I lose the background transparency. Which ImageFormat do I need to use? 

What do you want to do?
Scale picture with alpha?

Why do you use PictureMBS here?


For scale with mask, you can do this:

Function ProportionalScaled(extends pic as Picture, Width as Integer, Height as 
Integer) As Picture
  // Calculate scale factor
  
  dim faktor as Double = min( Height / Pic.Height, Width / Pic.Width)
  
  // Calculate new size
  dim w as Integer = Pic.Width  * faktor
  dim h as Integer = Pic.Height * faktor
  
  // create new picture
  dim NewPic as new Picture(w, h)
  
  // draw picture in the new size
  NewPic.Graphics.DrawPicture Pic, 0, 0, w, h, 0, 0, Pic.Width, Pic.Height
  
  // return result
  Return NewPic
End Function



Sincerely
Christian

-- 
Read our blog about news on our plugins:

http://www.mbsplugins.de/


_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
mbsplugins@monkeybreadsoftware.info
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to