Check empty canvas

I need to check if a canvas has content or is empty?, I do not get any property that allows me to do

define “empty”?
is all white empty?
is transparent empty?
depending on your viewpoint… a canvas is never empty… (NOT to be confused with a NIL graphics object… not the same thing)

subclass the canvas class
add a property named “dirty” as boolean
for each drawing you make in the canvas, set the dirty property to true

this way you can know if your canvas has been drawn or not.

But where does it take value if it has content?

My canvas will load a jpg file uploaded via web, and I want to detect when the canvas is not loaded

//Proceso de carga en canvas imagen url
dim url as String = A_Copiar
dim h as new HTTPSocket
dim f as FolderItem = SpecialFolder.Temporary.Child(“tmp_pic”)
if h.Get (url, f, 10) then
Win_Arte.Canvas1.Backdrop = Picture.Open(f)
end if

Draw the picture in the paint event rather than the backdrop. Then set your properties in the paint event too.

That still doesn’t help. What if the picture itself is blank?

Ready,Check the size of the recorded file and check whether it was loaded or not Picture.length > size