Advertisement
ExtremeHunter

WSH panel background repeat pattern

Sep 5th, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // image: 20x18 cross_bg.gif  http://www.traxsource.com/ background
  2. // background example repeat pattern 05.Sept.2013
  3.  
  4. var image = gdi.Image(fb.FoobarPath + "images\\cross_bg.gif");
  5.  
  6. var ww = wh = 0;
  7.  
  8. function on_paint(gr) {
  9.  
  10.     if (image) {
  11.  
  12.         var w = image.Width;
  13.         var h = image.Height;
  14.         var horizontalCount = Math.ceil(ww / w);
  15.         var verticalCount = Math.ceil(wh / h);
  16.  
  17.         for (var hi = 0; hi < horizontalCount; hi++) {
  18.             for (var vi = 0; vi < verticalCount; vi++) {
  19.  
  20.                 gr.DrawImage(image, hi * w, vi * h, w, h, 0, 0, w, h);
  21.  
  22.             }
  23.         }
  24.     }
  25. }
  26.  
  27. function on_size() {
  28.  
  29.     ww = window.Width;
  30.     wh = window.Height;
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement