Reputation: 21231
I have a large bitmap (pf24bit). I want to copy only a part (small rectangle) of that image to a canvas. The canvas is double buffered.
frmTester.Canvas.CopyRect()
will do the trick, but it has two problems:
BitBlt is super fast, but it will copy the entire bitmap.
Upvotes: 0
Views: 1053
Reputation: 109158
BitBlt
is super fast, but it will copy the entire bitmap.
Actually, no: BitBlt
allows you to copy only a rectangular part of the source, specified using the x1
, y1
, cx
, and cy
parameters.
However, the same width and height are used for the source and the destination rectangles, so BitBlt
cannot be used to stretch (or scale) the part you copy.
StretchBlt
lets you do this, though.
Upvotes: 3