troubleshooting Question

Canvas resize

Avatar of Peter Kiers
Peter KiersFlag for Netherlands asked on
Delphi
12 Comments1 Solution431 ViewsLast Modified:
Dear Experts,

I have a little programm with just a main-menu and my
own component. My component contains a black canvas
devided in 80 columns and 25 rows with a white cursor
draw on it. When I choose menu-item Fillbuf, the whole
canvas will be filled with characters. I don't know how to  
make a resize procedure!!!

I know I have asked this question before, but then I used
a TImage-canvas. Now I have a component that uses a
TCustomControl. This is what i received when i used a
TImage:

procedure TScreenf.FormResize(Sender: TObject);
var lf: LOGFONT;
begin
  ScrImage1.Picture.Bitmap.Width:= ClientWidth;
  ScrImage1.Picture.Bitmap.Height:= ClientHeight;
  GetObject(ScrImage1.Canvas.Font.Handle, SizeOf(lf), @lf);
  lf.lfWidth:= ClientWidth div 80;
  lf.lfHeight:= ClientHeight div 25;
  ScrImage1.Canvas.Font.handle:= CreateFontIndirect(lf);
  FontWidthPix:= lf.lfWidth;
  FontHeightPix:= lf.lfHeight;
  ShowBuf;
end;

I hope someone helps me.

I have put the little example on my site:

http://members.home.nl/peterkiers/

You see 2 floppy-disks download the Canvas2.zip

I hope someone can help me with this problem
I know I have asked this question more than once
But I can't do this on my own.

Peter K.


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros