Hello,
Just learning the graphics system, and having fits with what SEEMS to be a simple process…
My original program draws a hex grid. In the future, it would walk a path across the grid, then save the results as an image. I can’t for the life of me successfully print that Canvas. I finally created a scratch project, described below.
Test form consists of a canvas object and a single button. The only user-written code is in the button, and is listed below. I tried to simplify this when I couldn’t figure out the problem saving the image.
Trying to save a canvas (named imgMap) to a PNG after drawing a simple line on the canvas. The line itself is visible on the Canvas displayed on the form, so I know MOST of what is listed is correct.
PROBLEM: PNG file is successfully created, but is blank when opened - the line is not there. My [admittedly very simple] code follows.
===
dim oFolder as FolderItem
Dim pic As New Picture(125, 125, 24) ’ original canvas is 125 x 125 as well
oFolder = SpecialFolder.userhome.child(“Traverse”).Child(“test.png”)
frmMap.imgMap.graphics.drawline(0,0,100,100)
’ *** IS THERE A MISSING STEP HERE??? ***
frmMap.imgMap.DrawInto(pic.Graphics, 0, 0)
pic.Save(oFolder, Picture.SaveAsPNG)
===
Is there something I need to do between the DrawInto and save step???
Many thanks, this is driving me batty.