PictureEffectsRaw on Web

I use the Einhugur plugin in a desktop app to take a Picture and stretch it using PictureEffectsRaw, but now I want to do the same in a Web app.

The code moves across and has only a couple of issues before it will compile (and hopefully work!):

  1. RawBitmapConverter doesn’t seem to be available

Dim frontBitmap As RawBitmap cubePicture = … 'get the picture frontBitmap = RawBitmapConverter.FromPicture(cubePicture) 'RawBitmapConverter does not exist

  1. PolygonF.Draw(g) cannot handle WebGraphics

Dim frontFrame As PolygonF … frontFrame.Draw(g) 'cannot handle g as WebGraphics, only Graphics object

Anyone know of any fixes?

Use RawBitmapConverterConsole to do the Convert when on the web.

For the PolygonF.Draw(g), I would recommend creating a simple Method

Sub DrawPolyGonF(poly as PolygonF, g as WebGraphics)

// Use the PolygonF points here to feed into the WebGraphics DrawPolygon function

End sub

This should be very simple method. I do not know if I can conditionally put WebGraphics reference directly in the plugin. So making simple method like that in Xojo might be the best bet.

I just realized that there is a WebOnly flag, so maybe I can also make internal function for you that just works direction on WebGraphics. (I will report back)

Thank you. My work is based on your ShapeDistort example, so if this could work inside a Web App that would be great.

First tests look good so you might have updated TypeLibF maybe as early as tonight, where the Draw PolygonF, RectF and LineF can draw into WebGraphics.

That would be great, thank you.

Its out now, version 2.6.