Another problems:
When I minimize the form, the paintbox's image disapperars. How can I avoid
this?
When I draw a bitmap or jpeg image on the paintbox that is larger than the
paintbox's area, the scrollbars don´t appear although the paintbox is on a
scrollbox. How can I do a scrollable paintbox?
The above problems don't happen if I use a Timage component, but when I draw
on it, the image blinks. Why? How can I avoid that?
I`ll be very greateful if somebody can help me.
Carlos Ramírez E-mail: zen...@yupimail.com
implementation
var My_Bitmap : Tbitmap;
...
procedure Form1Create ..... bla bla
begin
My_Bitmap := TBitmap.create;
My_Bitmap.width := PaintBox1.Width;
My_Bitmap.height := PaintBox1.Height;
end;
Now in your save procedure, copy the paintbox canvas to the bitmap :
Assuming you've already added a SavePictureDialog to your form do this
procedure ButtonSaveClick(sender .... bla bla...)
begin
bitblt(My_Bitmap.Canvas.Handle,0,0,PaintBox1.Width,PaintBox1.Height,
Form1.PaintBox1.Canvas.Handle,0,0,SrcCopy); ..... a fast way
to do it.
if SavePictureDialog1.execute then
My_Bitmap.SaveToFile(Savedialog1.Filename);
end;
there you go ..... if I haven't made mistakes that is ... he he
Hope it works ..... regards Jeppe Andreasen