Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
196 views
in Technique[技术] by (71.8m points)

Delphi Image DLL not working in Azure

We have a dll to process some images of our software. I recently created an application in golang and it uses this DLL, everything works perfectly in a testing environment, but in azure, the images created are all black, I do not know if it is a delphi limitation, OS, azure, if someone has a tip.. Below the code that generates the image, even a simple code with only a Draw, the image turns black.

AOut := 'test.bmp';
vBitmap := TBitmap.Create;
vBitmap.Width := 2399;
vBitmap.Height := 3337;
vBitmap.PixelFormat := pf24bit;
vBitmap.Canvas.Brush.Color := clRed;
vBitmap.Brush.Style := bsSolid;
vBitmap.Canvas.FillRect(Rect(0,0,2399,3337));
vBitmap.SaveToFile(AOut);

An aditional information, if I get the information of height and width of the canvas I have everything 0 in the azure, but in the other machines the dimension is correct.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Azure App Service has some sandbox limitations, especially around GDI. As a result, some (or all) of your User32/GDI32 API calls fail.

Win32k.sys (User32/GDI32) Restrictions

For the sake of radical attack surface area reduction, the sandbox prevents almost all of the Win32k.sys APIs from being called, which practically means that most of User32/GDI32 system calls are blocked.

For most applications this is not an issue since most Azure Web Apps do not require access to Windows UI functionality (they are web applications after all).

See this wiki document for more.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...