[SOLVED] BGRABitmap and fpGUI Draw problem lazarus / 39-Graphics ---------------------------------------------------------------------- lainz · 2016-07-20 21:46 Hi, I'm creating a theme like I did for Custom Drawn (everything is the same and the method is similar). The problem I have is when I call bmp.Draw(ACanvas, Rect(x, y, w, h)) there is a crash- The problem does not exist if I use the Draw(ACanvas, 0, 0) but I need to use the rect method. Any ideas? The source is here (BGRAControls on GitHub), and the line in wich crashes: https://github.com/bgrabitmap/bgracontrols/blob/master/test/test_extra /fpGUI%20theme/mystyle.pas#L552 ---------------------------------------------------------------------- lainz · 2016-07-21 01:45 My fault, it's working The parameter is a Rect and I used W and H instead of Right and Bottom. This is the working code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i bmp.Draw(ACanvas, Rect(x, y, x+w, y+h)); ---------------------------------------------------------------------- Graeme · 2016-07-21 09:25 I had a brief look at your bitmap based theme. I've started some work on such a theme as well. I like your idea of reading the images and ini info out of a zip file. Makes much much easier deployment. As for the hardcoded initial 96 dpi value. You can read the runtime system dpi from fpgApplication.Screen_dpi. ---------------------------------------------------------------------- lainz · 2016-07-21 16:06 Quote from: Graeme on July 21, 2016, 11:25:07 amI had a brief look at your bitmap based theme. I've started some work on such a theme as well. I like your idea of reading the images and ini info out of a zip file. Makes much much easier deployment. As for the hardcoded initial 96 dpi value. You can read the runtime system dpi from fpgApplication.Screen_dpi. Ok I must think that fpgApplication.Screen_dpi is the current Windows setting of DPI. I can use it but I also need to use 96 because is the "Designed" DPI. Try to run my demo changing Windows DPI settings (to 125% or 150%). You will see that the controls and the form are scaled properly. Also I need to add manifest (also if I don't use windows themes) for the DPI-Aware setting that must be on in order to get a non-blurry form. ---------------------------------------------------------------------- Graeme · 2016-07-22 10:28 As I mentioned on Github, I already have a High DPI branch where I introduced a fpgApplication.DesignedDPI property for exactly that reason.  I'll try and get that branch completed ASAP and merge it into the main branches. That should make your life a lot easier. ---------------------------------------------------------------------- lainz · 2016-07-22 11:58 Thanks for your work.