0

i'm creating a application in angular with easeljs i'm stuck with simple step...i'm using angular material popup i want to load images in bitmap and it should open in grayscale...i did that but i m using cache for that(filters)...so my images wont load at the first time click

    let alphabet_A: any = new createjs.Container();
    var img_rect = new createjs.Shape();
    img_rect.graphics.setStrokeStyle(2).f('#FFFFFF').beginStroke("#000000").drawRect(0, 0, 180, 170);
    img_rect.setTransform(10, 30);
    var text_A = new createjs.Bitmap("/src/assets/Alphabet-Shelf/Images/Shelf_Caps_A.png");
    text_A.setTransform(20, 100, 0.8, 0.8);
    var text_B = new createjs.Bitmap("/src/assets/Alphabet-Shelf/Images/Shelf_Small_A.png");
    text_B.setTransform(115, 120);
    var text_C = new createjs.Bitmap("/src/assets/Alphabet-Shelf/Images/Anka.png");
    text_C.setTransform(80, 20, 0.7, 0.7);
    var text_D = new createjs.Bitmap("/src/assets/Alphabet-Shelf/Images/framered.png");
    text_D.setTransform(3, 23);
    text_D.alpha = 1;
    var text_E = new createjs.Bitmap("/src/assets/Alphabet-Shelf/Images/framegreen.png");
    text_E.setTransform(3, 23);
    text_E.alpha = 0;
    alphabet_A.name = "alphabet";
Akj
  • 7,038
  • 3
  • 28
  • 40
  • what is the error message you are seeing? – jmbmage Aug 13 '18 at 13:10
  • im not seeing any errors its running correctly but images wont load at very first time...then second time when i open the popup images loading correctly – sakthi vel Aug 13 '18 at 13:21
  • Then try loading all your images first. Put all the `new createjs.Bitmap` commands into a function that loads when the page is loaded. Then when the popup is loaded, just display the images (if already loaded). This should be fine if all the images are small in size. If they are large in size you may need to create a `promise` to wait for them to be loaded. – jmbmage Aug 13 '18 at 14:31
  • i was tried that too but not working thanks – sakthi vel Aug 14 '18 at 05:56

0 Answers0