| View previous topic :: View next topic |
| Author |
Message |
evgeniy Newbie

Joined: 24 Feb 2010 Posts: 2
|
Posted: Wed Feb 24, 2010 2:07 am Post subject: Picture stretching problem |
|
|
Hi!
Faced with a problem - with a stretching the picture means GDI+ the bottom and right sides not to reach the desired size. This effect is seen in the screenshot - the picture should close the red border frame, but instead formed gap. Besides the size of this gap depends on the stretching.
Here is an example of code that paints the picture:
| Code: |
var
Ii : TGPImage;
destRect : TGPRect;
P : TGPPen;
begin
Ii:=TGPImage.Create('D:\Photo\Чечня\Чёрная акула.JPG'); // pic size 640*480
JpgGDI:=TGPGraphics.Create(_dc);
// out coords and size
destRect.X:=10;
destRect.Y:=10;
destRect.Width:=1200;
destRect.Height:=500;
// pen for border
P:=TGPPen.Create(MakeColor(255,0,0),1);
JpgGDI.DrawRectangle(P,destRect);
JpgGDI.DrawImage(Ii,destRect);
end
|
screenshot url: http://s003.radikal.ru/i204/1002/22/94a622e22557.jpg
How to get rid of this gap? |
|
| Back to top |
|
 |
evgeniy Newbie

Joined: 24 Feb 2010 Posts: 2
|
Posted: Mon Mar 01, 2010 7:28 am Post subject: |
|
|
| I solved the problem. Now using the IJL. It quickly and without bugs. |
|
| Back to top |
|
 |
waynefulcher Newbie

Joined: 09 Jul 2010 Posts: 4
|
Posted: Fri Jul 09, 2010 9:11 pm Post subject: Solution please |
|
|
I am having a simular problem.
Would you mind posting your solution so I could see how you fixed it? |
|
| Back to top |
|
 |
|