Quote
Adam Roslon wrote:
> Adam Roslon <ros...@iconn.net> wrote in article
> <01bce546$e7827810$a380abcf@rc-1>...
> > I have been able to plgblt a rectangle to another rectangle at 90
> degrees
> > or a rectangle to a skewed parallelogram. I have had no Luck in doing
> the
> > reverse have been told by Microsoft that it can be done However they
> didn't
> > have a solution have attached a GIF file with a red parallelogram and a
> > blue rectangle If anyone has an idea of how to plgblt the contents of
> the
> > red parallelogram to the blue rectangle I would greatly appreciate it I
> > have been going nut trying to do it
> > Thank you
> > Adam
So _that's_ what a paralleogram is! Thanks for including the gif.
(Um, actually that red object is something known in mathematical circles
as a "rectangle" - of course rectangles are parallelograms...)
Doing your transformation "by hand" is much nicer than it used
to be because of TBitmap.ScanLine. Of course it won't be quite as fast
as plgblt, but it will be faster than you expect. I don't have NT so I
can't experiment with PlgBLT, but I can give you a hint: If you transform
the rectangle ABCD in Figure 1 to A'B'C'D' that should take the black
parallelogram to the black rectangle. More or less - I just made up the
numbers to give a general idea:
procedure TForm1.Figure1(Sender: TObject);
begin
with Canvas do
begin
Brush.Style:= bsClear;
Rectangle(30, 30, 330, 230);
TextOut(10, 10,'A');
TextOut(10, 250, 'B');
TextOut(340, 250, 'C');
TextOut(340, 10, 'D');
Polygon([Point(400,30),Point(400,230),Point(700,280),Point(700,80)]);
TextOut(380,10,'A''');
TextOut(380, 250, 'B''');
TextOut(720, 300, 'C''');
TextOut(720, 60, 'D''');
Brush.Style:= bsSolid;
Brush.Color:= clBlack;
Polygon([Point(50,100),Point(50,200),Point(310,150),Point(310,50)]);
Rectangle(420,100,680,200);
end;
end;
--
David Ullrich
sig.txt not found