Beispiel #1
0
        public override Bitmap GetBitmap()
        {
            if (this["_inlink"] is WzStringProperty inlink)
            {
                WzObject currentWzObj = this; // first object to work with
                while ((currentWzObj = currentWzObj.Parent) != null)
                {
                    if (!(currentWzObj is WzImage))  // keep looping if its not a WzImage
                    {
                        continue;
                    }

                    WzImage         wzImageParent = (WzImage)currentWzObj;
                    WzImageProperty foundProperty = wzImageParent.GetFromPath(inlink.Value);
                    if (foundProperty != null && foundProperty is WzImageProperty)
                    {
                        return(foundProperty.GetBitmap());
                    }
                }
            }
            else if (this["_outlink"] is WzStringProperty outlink)
            {
                WzObject foundProperty = WzFileParent.GetObjectFromPath(outlink.Value);
                if (foundProperty is WzImageProperty)
                {
                    return(foundProperty.GetBitmap());
                }
            }
            return(imageProp.GetPNG(false));
        }
Beispiel #2
0
        public override Bitmap GetBitmap()
        {
            if (InLink != null)
            {
                WzObject currentWzObj = this; // first object to work with
                while ((currentWzObj = currentWzObj.Parent) != null)
                {
                    if (!(currentWzObj is WzImage)) // keep looping if its not a WzImage
                    {
                        continue;
                    }

                    WzImage         wzImageParent = (WzImage)currentWzObj;
                    WzImageProperty foundProperty = wzImageParent.GetFromPath(InLink.Value);
                    if (foundProperty != null && foundProperty is WzImageProperty)
                    {
                        return(foundProperty.GetBitmap());
                    }
                }
            }
            else if (OutLink != null)
            {
                WzObject foundProperty = WzFileParent.GetObjectFromPath(OutLink.Value);
                if (foundProperty?.OutLink != null)
                {
                    if (foundProperty.WzFileParent.GetObjectFromPath(foundProperty.OutLink.Value) == this)
                    {
                        Console.WriteLine("RECURSION FOUND");
                        // recursive linking, who the f**k did this??
                        return(null);
                    }
                }

                if (foundProperty is WzImageProperty)
                {
                    return(foundProperty.GetBitmap());
                }
            }

            return(imageProp.GetPNG(false));
        }
Beispiel #3
0
 public override Bitmap GetBitmap()
 {
     return(imageProp.GetPNG(false));
 }
Beispiel #4
0
 internal override Bitmap ToBitmap(Bitmap pDef = null)
 {
     return(mImageProp.GetPNG());
 }
Beispiel #5
0
 internal override System.Drawing.Bitmap ToBitmap(System.Drawing.Bitmap def)
 {
     return(imageProp.GetPNG(false));
 }