VFP编写的旋转图片程序

更新时间:2023-05-14 13:31:09 阅读: 评论:0

PROCEDURE Rotate(ImageFile,OutName,angle)
DECLARE INTEGER GdipLoadImageFromFile IN gdiplus.DLL STRING wFilename, INTEGER @nImage
DECLARE INTEGER GdipSaveImageToFile IN gdiplus.DLL INTEGER nImage, STRING wFilename, STRING qEncoder, STRING  小学英语五年级下册
DECLARE INTEGER GdipGetImageHeight IN gdiplus.dll INTEGER  img,INTEGER @ imgheight
DECLARE INTEGER GdipGetImageWidth IN gdiplus.dll INTEGER  img,INTEGER @ imgwidth
DECLARE INTEGER GdipDispoImage IN gdiplus.dll INTEGER  img教师节国旗下讲话稿
DECLARE INTEGER GdipRotateWorldTransform IN gdiplus.dll Long,Single,long
DECLARE INTEGER GdipTranslateWorldTransform IN gdiplus.dll Long,Single,Single,long
Declare INTEGER GdipDrawImageRect IN gdiplus.dll Long,Long,Single,Single,Single,Single
DECLARE INTEGER GdipGetImageGraphicsContext IN gdiplus.DLL INTEGER,INTEGER @
DECLARE INTEGER GdipCreateBitmapFromScan0 IN gdiplus.DLL INTEGER, INTEGER, INTEGER,INTEGER,STRING @, INTEGER @
DECLARE INTEGER GdipGraphicsClear IN gdiplus.DLL long,Long
DECLARE INTEGER GdipDeleteGraphics IN GdiPlus.dll INTEGER
nutritious
nGraphics=0
nImage1=0
nimage=0
GdipLoadImageFromFile(AnsiToUnCode(ImageFile),@nimage)
w=0
h=0
GdipGetImageWidth(nImage,@w)
GdipGetImageHeight(nImage,@h)
lcEncoder=0h01F47C55041AD3119A730000F81EF32E中秋快乐 英文
SinAngle=SIN(DTOR(angle))
CosAngle=COS(DTOR(angle))
DO CASE
CASE angle<=90
w1=w*CosAngle+h*SinAngle
h1=h*CosAngle+w*SinAngle
greece
w2=h*SinAngle
h2=0
CASE angle>90 AND angle<=180
chris hughesw1=h*SinAngle-w*CosAngle
h1=w*SinAngle-h*CosAngle
w2=h*SinAngle-w*CosAngle
h2=-h*CosAngle
CASE angle>180 AND angle<=270
w1=-(w*CosAngle+h*SinAngle)
h1=-(h*CosAngle+w*SinAngle)
npr news
w2=-w*CosAngle
英文翻译器在线翻译h2=-h*CosAngle-w*SinAngle
OTHERWISE
w1=w*CosAngle-h*SinAngle
h1=h*CosAngle-w*SinAngle
w2=0
h2=-w*SinAngle
ENDCASE
GdipCreateBitmapFromScan0(w1,h1,0,925707,0,@nImage1)
GdipGetImageGraphicsContext(nImage1,@nGraphics)
GdipRotateWorldTransform(nGraphics,angle,1)
GdipTranslateWorldTransform(nGraphics,w2,h2,1)
GdipGraphicsClear(nGraphics,-1)
GdipDrawImageRect(nGraphics,nImage,0,0,w,h)
GdipSaveImageToFile (nImage1, AnsiToUnCode(OutName), lcEncoder,Null)
GdipDeleteGraphics(nGraphics)
fun怎么读GdipDispoImage(nImage1)
GdipDispoImage(nImage)
PROCEDURE AnsiToUnCode(_InStr)
duke
DECLARE Long MultiByteToWideChar In kernel32 Long iCodePage, Long dwFlags, String @ lpStr, Long iMultiByte,String @ lpWideStr, Long iWideChar
InLen=Len(_InStr)
OutLen=2*InLen+1
_OutStr=Replicate(Chr(0),OutLen)
MultiByteToWideChar(0,0,_InStr,InLen,@_OutStr,OutLen)
RETURN _OutStr

本文发布于:2023-05-14 13:31:09,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/108182.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:讲话稿   小学   教师节   下册   国旗
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图