As a workaround you could try Line(x,y,x+1,y+1,color)Please Erel, adds the SetPixel method (to change the color of a pixel) to Form object!!!
Example?The Line method don't works correctly for some applications!
Sub App_Start
Form1.Show
bmp.New2(Form1.Width,Form1.Height)
End Sub
Sub Form1_MouseDown (x,y)
bmp.SetPixel(x,y,cRed)
Form1.Image = bmp.Value
End Sub
The problem is not a lack of memory per se but you are running out of stack space on the device. I think that your only solution is to write a non-recursive routine.The recoursive method that i use for FloodFill function use a lot of memory.
It's not so strange if you know what the underlying .NET functions do.It seems having a somewhat strange behaviour:
Line(x,y,x+1,y+1,color) gives a line of two pixels
Line(x,y,x+1,y+1,color,B) gives a square of four pixels
Line(x,y,x+1,y+1,color,BF) gives a single pixel ?
No. BF doesn't mean Border and Fill separately it is just a flag to say which actual .NET graphics function is called. Here is the code from my FormExDesktop library to show what I mean. It is in C# but it should be reasonably clear what's happening. Inside Basic4PPC the code will be very similar.Additional question: can the border and fill colors be different ?
public void bLine(int x1, int y1, int x2, int y2, int col, String fmt)
{
Rectangle rect = new Rectangle(x1, y1, x2 - x1, y2 - y1);
switch (fmt.ToLower())
{
case "b" :
PaintGraphics.DrawRectangle(new Pen(Color.FromArgb(col)), rect);
break;
case "bf" :
PaintGraphics.FillRectangle(new SolidBrush(Color.FromArgb(col)), rect);
break;
default :
PaintGraphics.DrawLine(new Pen(Color.FromArgb(col)), x1, y1, x2, y2);
break;
}
}
If I knew how you were implementing the magnified area I might be able to help. Do you want to post some example code?Unfortunately a have to use the slow version becaus I don't only use bitmap but also a magnified area. On the device it takes about 9s to fill the whole 32*32 square, it's not too bad
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?