I want to stretch picture and save it by BMP format (to add into a Imagelist). If the source picture contain a bitmap, this code work correctly:
Procedure Newpicture(Source:Tpicture;Var DesBMP:Tbitmap;newW,newH:integer);
For i:=0 to newW-1 do
for j:=0 to newH-1 do
with Source.bitmap do
DesBMP.canvas.pixels[i,j]:=Canvas.pixel[i*width div newW,j*height div newH];
But the problem come with me if source picture contain a Metal Image or a JPEG Image. If JPEGImage, I can use SaveToClipboardFormat and then use tmpBMP(another Tbitmap).LoadFromClipboardFormat and continue use the code above. But metal image is not! I think, there is simple code (maybe you know but I don't know) can solve my problem. I need yours' helping!