Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...