Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

8 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Of course, and indeed I do that all the time as well. What I meant was I may want to edit a form and leave the rest unchanged. Then I have one form saved with dpi 150% and the other ones still with 100% .. I think Then I'd need to query the form to know with what dpi setting it was saved during design
  2. Me too but it turns out I'm more comfortable with 150%. Not the youngest anymore, reading glasses and all that .. Sure, but what about the main form in an opened project ? Perhaps no changes were saved to file, but already changed in memory. Also, what if a form needs to be edited, yet all the other forms are still OK and should remain unchanged. I have some code that relies on the design dpi, currently hard coded, because I found no way to check the design time dpi per form.
  3. Hi, I have a C++ Builder 11.2 project that is compiled on a machine with 100% scale setting. I put in considerable work to make sure that dynamically resized objects (based on content, text etc) all scale properly between different dpi monitors etc. I'm now moving my project to a new main system with a bigger screen and I want to use the default 150% scale setting on this machine I'm still not 100% on the whole scaling thing. PixelsPerInch return confusing values sometimes and I'm also not fully sure what is stored during design etc. My question, if/when I rebuild this project 'as is' on the new system, will it still look the same when deployed on a 100% scaled system etc ? Do I need to make changes ? Re-save all the forms ? Any input before I start messing things up is greatly appreciated. Peter
  4. CyberPeter

    RAD Studio 11.0 Support

    Thanks for the heads-up I'm still on 11.1 I simply link in ics .lib and .a files, built with 11.1 Any idea if I should rebuild these libraries with 11.2 when I update my main project to 11.2 ?
  5. And the morning brings clarity .. 🙂 Turns out I still had the form's 'TransparentColor' property set to 'true' (Left over from my first attempt, see start of conversation). I reset it to 'false' and now above code works beautifully. This window cannot be moved with the mouse. Frankly, I'm not sure what code or setting is responsible for this difference in behavior
  6. I built and played a bit with your code Anders and it works nicely. Stubborn as I am I created a smaller class with only a splash, highly inspired by your code (also my old code so it seems, there is certainly overlap - but now I'm able to ignore a lot of old crap and rely on PNG). Sadly my today's implementation doesn't work fully. I must be missing something, but I cannot spot it. Perhaps it's obvious ? Anybody any idea as to why UpdateLayeredWindow() always fails with error 87 ( ERROR_INVALID_PARAMETER ). I can't seem to find where the problem lies //--------------------------------------------------------------------------- void __fastcall TForm1::Button3Click(TObject *Sender) { String ResourceName(L"SPLASH2") ; TSplashScreen *Splash = new TSplashScreen(3000, 100, ResourceName) ; Splash->Show() ; } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- __fastcall TSplashScreen::TSplashScreen(int TimeToDisplay, int Alpha, const String &ResourceName) : TForm((TComponent*)NULL), FBitmap(NULL), Alpha(Alpha) { Timer->Interval = TimeToDisplay ; Timer->Enabled = false ; // Set Layered if (SetWindowLong(Handle, GWL_EXSTYLE, (GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_LAYERED))) { // Background covers whole form ControlStyle << csOpaque ; // Create BitMap FBitmap = new TBitmap ; // Load the PNG from resource LoadPNG(ResourceName) ; // Resize form to fit bitmap ClientWidth = FBitmap->Width ; ClientHeight = FBitmap->Height ; } } //--------------------------------------------------------------------------- __fastcall TSplashScreen::~TSplashScreen() { delete FBitmap ; } //--------------------------------------------------------------------------- void __fastcall TSplashScreen::TimerTimer(TObject *Sender) { Timer->Enabled = false ; // This event only once Hide() ; Application->ProcessMessages() ; delete this ; // Self destruct when time is up } //--------------------------------------------------------------------------- void __fastcall TSplashScreen::FormShow(TObject *Sender) { Display(Alpha) ; if (Timer->Interval) Timer->Enabled = true ; } //--------------------------------------------------------------------------- void TSplashScreen::LoadPNG(const String &ResourceName) { TStream *Stream = NULL ; __try // Load PNG from resource (which must be added to the project) { wchar_t Type[] = L"PNG" ; Stream = new TResourceStream((NativeUInt)HInstance, ResourceName, Type) ; TPngImage *PNG = NULL ; __try { PNG = new TPngImage ; PNG->LoadFromStream(Stream) ; FBitmap->Assign(PNG) ; FBitmap->PixelFormat = pf32bit ; FBitmap->AlphaFormat = afPremultiplied ; } __finally { delete PNG ; } } __finally { delete Stream ; } } //--------------------------------------------------------------------------- void TSplashScreen::Display(int Alpha) { // Position bitmap on form POINT BitmapPos = {0, 0} ; SIZE BitmapSize = {FBitmap->Width, FBitmap->Height} ; // Setup alpha blending parameters BLENDFUNCTION BlendFunction ; BlendFunction.BlendOp = AC_SRC_OVER ; BlendFunction.BlendFlags = 0 ; BlendFunction.SourceConstantAlpha = Alpha ; // Transparency Value (255 is not transparent, 0 is fully transparent) BlendFunction.AlphaFormat = AC_SRC_ALPHA ; // Display if (!UpdateLayeredWindow(Handle, 0, NULL, &BitmapSize, FBitmap->Canvas->Handle, &BitmapPos, 0, &BlendFunction, ULW_ALPHA)) { DWORD Error = GetLastError() ; } Application->ProcessMessages() ; } //---------------------------------------------------------------------------
  7. Oh cr@p, good point. Not doing that though 😉 Oh wow, thank you very much Anders. I'm not good with Delphi (at all), so I will need some time to digest this.
  8. My app has a splash screen, but it was created at least 16 years ago (BCB5 I think) and I'm really ready for something else. It's based on two BMP's. One is used as a mask to tell the code what should be transparent. Instead of hurting my (currently covid impaired) head trying to figure out the old code and ancient methods of then, surely VCL Forms and graphic support has evolved to something where this is a lot easier to do ? I recently upgraded to C++ Builder 11 (coming from Builder 2009) I was thinking of finding a graphical artist who can make me a nice *.png that I then use as splash screen. It's far easier to ask someone to make a nice PNG than to describe the need for two BMPs, one of which acts purely as a mask etc. I tried a few things with a free test.png found on the net (artist unknown), but I'm not having the easy success I hoped I'd have. Are there good and easy ways to do this using Builder / Delphi 11 ? I looked around but wasn't very successful in finding documentation. I see Anders has a couple blog posts about it, but that too seems outdated (correct me if I'm wrong). The easy: - I created a Windows VCL test app - Set Form BorderStyle = bsNone - Plonked a TImage on the form (Align = allClient) - Loaded the test.png in Image1's Picture at design time - Compiled. Works nicely but of course the form color shows where the PNG is transparent - I then set the Form background to MoneyGreen, TransparentColor = true, TransparentColorValue = clMoneyGreen - Compiled. Nice result but the PNG half transparent regions blend with the green color, and are hence not blending with the background. - The net result is sadly not perfect. It was simply too easy 😉 I made this screenshot on a white background. If I set AlphaBlend = true and give it an AlphaBlendValue = 100 (for instance) there are certainly very nice additional features to play with: Now, this doesn't need to be total failure. - I could experiment with different Form background colors and see how they interact with the half transparent fields of the PNG. Perhaps the net result is pleasing. - I could ask the artist to make me a transparent PNG but with well defined edges that don't blend, that are not half transparent. In conclusion, as far as super easy methods go, this certainly is not a bad start if a good color compromise can be found for the blending issues and/or depending on the PNG. But ... perhaps I'm missing quite a few things that can be done to achieve a perfect result ? Please let me know. Thanks. The test.png also attached:
  9. Sadly that's at an unholy hour for people in Australia, certainly for those with kids. (2:30 am in South Australia) I dread having to wait for an edited video on YouTube.
  10. It would explain a lot. But they owe us transparency. It should be part of the 'contract' we entered when we paid the license fee. We're not a knitting group, we're all professionals trying to get our work done. We need to know what is happening (to some extent) and what is being done about it (to some extent) so that we can properly plan and communicate to our 'dependants' (customers, management, ..)
  11. I recently upgraded my old C++ Builder 2009 to C++ Builder 11. It was time .. and I wanted to make use of the new GUI improvements (Styles, Scaling, High DPI etc). GUI stuff in other words. To that end I spent a lot of money to get a license. Everything is relative, but to me this is the biggest investment in quite some time and the biggest software investment ever. I have always been happy with Builder 2009 and yes, there were some issues that I had to work around, but not too many. Since I have upgraded I have already reported close to 20 bugs. Never ever did I have to .. It's also making me nervous as to when these things will get fixed, if at all, as it impacts my work. The silver lining at least was that my bugs triggered interaction. I saw them being escalated to development or they were assigned to me again to provide more information. All that has stopped in the last few weeks. For all the last bugs there has been zero interaction. Nothing, as if nobody cares. The GUI work involves custom controls for which I need the help files, to be able to apply the Styles properly etc. In itself already poorly documented but for 3 weeks now docwiki has predominantly been unavailable. There are already other posts about that, so I won't get into the specifics of that, but it adds to what looks like a systemic failure. - Many bugs in the very features they're touting about and that convinced me to upgrade - Nothing appears to be done about it, nobody seems to care - Docwiki offline, nothing seems to be done about it, nobody (at embarcadero) seems to care The person most responsive in QA before and who has not responded anymore has a Ukrainian name. Perhaps coincidence, perhaps my paranoia but how exposed is Embarcadero development and support to Ukraine. Is this the reason for all the recent issues ? If so, communicating about it would at least renew confidence. All this nonsense would not be necessary if they would just COMMUNICATE about the issues (docwiki for instance). The silence only feeds the idea of a failing company or at least a failing product and I feel bad for having invested my time and money in this at this stage. My 'happy life' with Builder 2009, the type of work I'm doing with it and the low exposure to issues may have made me blind to something that is well known and has been happening for years ? I don't know ? Maybe I shouldn't worry because this is business as usual ? In which case I wish I had done my homework though.
  12. CyberPeter

    docwiki.embarcadero.com is not working

    It's an absolute disgrace. They really don't care do they ? Plenty of bugs reported already on this issue in https://quality.embarcadero.com (also by me). They tend to get closed as 'resolved' and duplicate. Must be good for the stats. I don't know what's worse, not being able to fix something like this or totally ignoring the community and not communication about it at all.
  13. CyberPeter

    RAD Studio 11.0 Support

    Thank you Angus. I downloaded the overnight zip and built the run-time packages again. I did not bother with the design time packages this time as I don't need them anyway. All built OK and I could use the *.hpp files together with the *.obj / *.o files to get HttpCli to work in a 32 and 64 bit test app. I saw the exact same result as with previous overnight zip that I tried.
  14. CyberPeter

    RAD Studio 11.0 Support

    To complete my questions to this thread, and for future reference and search engines. I revisited this today after I had a light bulb moment. Before I could use the newly compiled package (run time package only) I obviously had to link in the compiled code. So I added #pragma link "OverbyteIcsHttpProt" to the .cpp file of a little test app and that did the trick (for my very limited use) The test app uses THttpCli and the header file links to: #include "OverbyteIcsHttpProt.hpp" And it works OK (32 and 64 bit) on any URL that is not SSL, for instance http://brightbeautifulsilversong.neverssl.com/online I will be using it on a non-SSL link, so that is that. 32 bit: On a URL that uses SSL there is an exception, by design, and the ReasonPhrase is "Abort on Exception: SSL requires a context object". So, all good. 64 bit: On a URL that uses SSL there is an ugly exception that I believe is not by design (!). If this is due to my build/ c++/system then so be it, if there is an issue, perhaps you can repeat ? In any case, a different thread I assume.
  15. CyberPeter

    RAD Studio 11.0 Support

    Thank you Angus, I notice that my compiles did not create *.lib files, which hence cannot be linked. So it appears my build efforts were not successful after all and I'm as stuck as before. Hopefully some (recent) c++ builder with component experience users will chime in when they can.