Example #1
0
        public bool InsertImageUseImageOle(string path)
        {
            try
            {
                IGifAnimator gif = new GifAnimatorClass();
                gif.LoadFromFile(path);

                gif.TriggerFrameChange();
                if (gif is IOleObject)
                {
                    int      index = _index++;
                    REOBJECT reObj = RichEditOle.InsertOleObject(
                        (IOleObject)gif,
                        index);
                    RichEditOle.UpdateObjects(reObj.cp);
                    OleObjectList.Add(index, reObj);
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Example #2
0
 public bool InsertImageUseDynamic(string path)
 {
     try
     {
         IDynamicGif gif = new DynamicGifClass();
         gif.LoadFromFile(path);
         gif.Play();
         if (gif is IOleObject)
         {
             int      index = _index++;
             REOBJECT reObj = RichEditOle.InsertOleObject(
                 (IOleObject)gif,
                 index);
             RichEditOle.UpdateObjects(reObj.cp);
             OleObjectList.Add(index, reObj);
             return(true);
         }
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }