Posts ID:169179 Favorites Creations
 ID:169179   Jul 21 2005, 8:16 pm After hours of painful work of trying to enlarge an icon by scale factor of 2 (in other words, stretching the icon so that it's double its size) all I've managed to achieve is being able to stretch the icon, by scale factor of 2, either vertically or horizontally. So my question; what is needed to make a single pixel be double its size?
 #1 Jul 21 2005, 8:25 pm Get each line of the icon into a list and then add it back to the icon doubled by shifting the second output either north or east...right? -Ryan
 #2 Jul 21 2005, 8:27 pm In response to Ry4n (#1) That effectively would give this wouldn't it? O CO Where C is the original pixel/line and O is the copied version just shifted.
 #3 Jul 21 2005, 8:32 pm In response to DeathAwaitsU (#2) Just use paint. =p
 #4 Jul 21 2005, 8:35 pm In response to Digital Samurai (#3) No I'm not trying to edit/make icons. I'm trying to achieve this: Icon Scaling by OneFishDown I just need to know, what makes a pixel look doubled.
If it helps then here's my way of scaling you by a factor of 2 horizontally.

 ```mob/verb/ScaleHorizontally() var/icon/I = icon(usr.icon) usr.icon = null var/py = 0 var/px = 0 var/bottomshifter = 0 while(py<=31) //loop through every horizontal line py ++ px = 0 bottomshifter = 0 while(px<=31) //loop through every pixel within the line px++ var/icon/G = icon('Blank.dmi') var/icon/H = icon('Blank.dmi') var/icon/GH = icon('Blank.dmi') var/icon/pixel = I.GetPixel(px,py) //get the pixel that we're working on G.Blend(pixel,ICON_OR) //put that pixel on another icon G.Shift(EAST,px,1) //move the pixel east, to our scaled location H.Blend(pixel,ICON_OR) //make another icon with the pixel H.Shift(EAST,bottomshifter,1) //move the new pixel east, directly to the left of where the other pixel was GH.Blend(G,ICON_OR) //add the two pixels into one icon, they should now be right next to each other giving a strethched effect GH.Blend(H,ICON_OR) bottomshifter++ if(px>16) //after we do the above for 16 pixels, we now need to go above the 32x32 region var/image/J = image(GH) //create an image J.pixel_x = 32 //adjust the offset so that it's now going to be one icon to the right usr.overlays += J //add it as an overlay else usr.overlays += GH //add it as an overlays ```

While on this subject by the way, I was wondering why it stops working after py = 16?
 #6 Aug 2 2005, 5:08 am Maybe graphics will help? The one on the left is the original. The one on the right is a doubled version of it. You'll notice that it isn't really doubled because it hasn't been enlarged upwards but only to the right. So using this, can someone answer my question?
 #7 Aug 2 2005, 11:03 pm In response to DeathAwaitsU (#2) You'd want this: OO CO
 #8 Aug 3 2005, 2:09 am In response to Xooxer (#7) That is what I did with [link] but it only stretched horizontally.