xy:=PInt64(mymessage.WParam)^; tx:= xy shr 32; ty:=xy and $ffffffff; wh:=PInt64(mymessage.LParam)^; tw:=wh shr 32; th:=wh and $ffffffff; bmp2png.Width:=tw; bmp2png.Height:=th; except on E: Exception do begin s:='xywh '+e.Message; MessageBox(form1.Form2.Handle,pwidechar(s),'',MB_ICONEXCLAMATION); end; end;
if Assigned(filepng) and Assigned(bmp2png) then if (bmp2png.Width>0)and(bmp2png.Height>0) then begin try filepng.Assign(bmp2png);//这里报错为什么呢??? except on E: Exception do begin s:='png创建失败 '+e.Message +char(13)+'filepng' +char(13)+intTostr(filepng.Width) +char(13)+intTostr(filepng.Height) +char(13)+'bmp2png' +char(13)+intTostr(bmp2png.Width) +char(13)+intTostr(bmp2png.Height);
end; end; try filepng.CreateAlpha; except on E: Exception do begin s:='pngCreateAlpha创建失败 '+e.Message; MessageBox(form1.Form2.Handle,pwidechar(s),'',MB_ICONEXCLAMATION); end; end; end;
finally FreeAndNil(bmp2png); end;
错误提示: First chance exception at $75CAC54F. Exception class EInvalidPointer with message 'Invalid pointer operation'. 进程Project1.exe (7068)
----------------------------------------------
-