I totally agree ! But on such device, you can turn your phone in landscape mode (could you try if it's readable please ?)
In landscape the image is still too large for HTC Wildfire. It has a resolution of 240x320 so in landscape the width is 320
But on tablet it'll be problematic, cause the size is way bigger, and the image will be ugly, I don't have such devices to test.
In this case you need to stretch the image, or make 2 versions of it. 1 would be a pre-stretched which has 2 times the size of the original.
You spoke about onpaint, but can I add an image with onpaint function ?
Of course. OnPaint is *the drawing event*. You can draw anything there. All controls which exist in LCL-CustomDrawn are painted in the OnPaint event.
Maybe you should start by studying lazeyes:
http://lazarus-ccr.svn.sourceforge.net/viewvc/lazarus-ccr/applications/lazeyes/lazeyes2painter.pas?revision=2421&view=markupSee line 81:
81 procedure TLazEye2Painter.DrawToCanvas(ACanvas: TCanvas);
82 begin
83 // Background
84 ACanvas.Brush.Color := clWhite;
85 ACanvas.Pen.Color := clWhite;
86 ACanvas.FillRect(0, 0, Width, Height);
87
88 // Eyes form
89 ACanvas.Pen.Color := clBlack;
90 ACanvas.Pen.Width := 5;
91 ACanvas.Ellipse(
92 0,
93 0,
94 INT_OUTER_EYE_WIDTH,
95 INT_OUTER_EYE_HEIGHT);
96 ACanvas.Ellipse(
97 INT_OUTER_EYE_WIDTH + INT_INTEREYE_SPACE,
98 0,
99 2* INT_OUTER_EYE_WIDTH + INT_INTEREYE_SPACE,
100 INT_OUTER_EYE_HEIGHT);
101
102 // Eyes pupils
103 ACanvas.Brush.Color := clBlack;
104 ACanvas.Pen.Width := 10;
105 ACanvas.Ellipse(
106 LeftEyePos.X - 2,
107 LeftEyePos.Y - 2,
108 LeftEyePos.X + 2,
109 LeftEyePos.Y + 2);
110 ACanvas.Ellipse(
111 RightEyePos.X - 2,
112 RightEyePos.Y - 2,
113 RightEyePos.X + 2,
114 RightEyePos.Y + 2);
115 end;
This routine paints this app:
http://wiki.lazarus.freepascal.org/LazEyes#ScreenshotsRead the docs about TCanvas too:
http://lazarus-ccr.sourceforge.net/docs/lcl/graphics/tcanvas.htmlTo draw an entire bitmap use this routine:
http://lazarus-ccr.sourceforge.net/docs/lcl/graphics/tcanvas.draw.htmlTo draw part of a bitmap or to stretch use this:
http://lazarus-ccr.sourceforge.net/docs/lcl/graphics/tcanvas.copyrect.html