Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

10 Good

Recent Profile Visitors

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

  1. FreeAndNil() - The Great Delphi Developer Debate https://s608.t.en25.com/e/es?s=608&e=5507850&elqTrackId=65d0dc3c5cdd4756be52277591b686f0&elq=bbc2a556cfa141cc926d04a00819b81d&elqaid=44034&elqat=1 OMG. What? Again? Unbelievable! :-) The following MVPs have shared their opinion on the topic. Register now to see what they have to say! Allen Bauer, Dalija Prasnikar, Frank Lauter, Uwe Raabe, Paul TOTH, Radek Cervinka, Olaf Monien, Dr. Holger Flick, Patrick Prémartin, Boian Mitov, Matthew Vesperman, Vinicius Sanchez, Darian Miller, Juliomar Marchetti, Erik van Bilsen, and Nick Hodges
  2. AlexBelo

    QP: select my watches. Is this possible?

    Thank you, it works.
  3. Hi all. Is this possible to select on QP only reports which I marked with "Start watching this issue"? -- Alex
  4. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    AFAIR, there was QC (old borland quality control system) report about 16bit API calls in VCL (in some components if memory serves).
  5. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    > I don't know why you would prefer DDB when you're working with bitmaps that large. Use DIBs instead. They are backed by virtual memory. Exactly by reason of "my" virtual memory: DDB resides somewhere in GDI (out of my process); I simply has no memory to hold bmp data in my memory during subsequent operations. OK, further investigations have more academical interest because workaround (manual call of StretchBlt) is already found ...
  6. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    I've found the only related question (without answer) GDI+ Bitmap size limitation? (December 1st, 2006) https://forums.codeguru.com/showthread.php?407837-GDI-Bitmap-size-limitation Also I've noticed that if I comment out Image->Picture->Bitmap->PixelFormat=pfDevice; the problem exists only when initial bmp has pfDevice or pf32bit (the same as pfDevice, AFAIUI) format. Upd: CDC Class (MFC, not very relevant, but ...) https://docs.microsoft.com/en-us/cpp/mfc/reference/cdc-class?view=msvc-160
  7. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    void TForm1::AdjImage(bool stretch) { if(stretch) { ScrollBox->VertScrollBar->Visible=false; ScrollBox->HorzScrollBar->Visible=false; Image->AutoSize=false; Image->Width=ScrollBox->ClientWidth; Image->Height=ScrollBox->ClientHeight; Image->Stretch=true; } else { Image->Stretch=false; Image->AutoSize=true; ScrollBox->VertScrollBar->Visible=true; ScrollBox->HorzScrollBar->Visible=true; } } void __fastcall TForm1::btnCreateBmpClick(TObject *Sender) { AdjImage(cbStretch->Checked); // preparing Image according to desired view unsigned int w=seW->AsInteger; // test dimensions unsigned int h=seH->AsInteger; TPixelFormat pf; if(rbDevice->Checked) pf=pfDevice; else if(rb8bit->Checked) pf=pf8bit; else if(rb24bit->Checked) pf=pf24bit; else pf=pf32bit; TcppBitmap bmp; bmp->PixelFormat=pf; bmp->SetSize(w, h); TColor c; if(pf!=pf8bit) c=clRed; else c=clBlack; bmp->Canvas->Pen->Color=c; // some testing draw bmp->Canvas->Pen->Width=10; bmp->Canvas->MoveTo(5, 0); bmp->Canvas->LineTo(5, h); bmp->Canvas->MoveTo(0, 0); bmp->Canvas->LineTo(w, h); bmp->Canvas->Pen->Width=1; bmp->Canvas->MoveTo(0, 0); bmp->Canvas->LineTo(w, 0); bmp->Canvas->LineTo(w-1, 0); bmp->Canvas->LineTo(w-1, h-1); bmp->Canvas->LineTo(0, h-1); bmp->Canvas->LineTo(0, 0); Image->Picture->Assign(bmp); // show in Image Image->Picture->Bitmap->PixelFormat=pfDevice; // "move into GDI domain" (out of application's memory space) Image->Picture->Bitmap->FreeImage(); // deallocate DIB-section (if initial bmp was not pfDevice) if(pf!=pf8bit) c=clGreen; else c=clGray; // another test (on Image internal bitmap now) Image->Canvas->Pen->Color=c; Image->Canvas->Pen->Width=10; Image->Canvas->MoveTo(20, 0); Image->Canvas->LineTo(20, h); } Results: left - H<32768 (as expected), right H=32768 (usually random pieces of desktop).
  8. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    > 32768 x 32768 x 24 bit ---> 3 Gb No, I mean any dimention (not both) like 1024*32768. I suspect that somewhere in VCL some "size parameter" is word (not cardinal). It would be nice to check this issue in current version.
  9. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    After some experiments: - if I do StretchBlt manually into intermediate bmp the result is always correct (i.e. this API call works as expected even with huge bmp ~1Gb); - if I set Image->Stretched=true and perform Image->Picture->Assign(bmp), the resulting picture in Image on a form is totally wrong when bmp->Width or Height is >32767; tracing into Graphics unit doesn't show anything suspicious (the same call of StretchBlt with correct parameters) ... So as workaround I have to create stretched image manually...
  10. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    > Graphics32 Unfortunately I can not use 32bit images due to memory limits. As I mentioned above I use RAD2007 and 32bit compiler. Even on Win64 (where 32bit app can use nearly 4 Gb of memory) I have not enough continuous memory for 32bit image (24bit bmp is still workable in my case).
  11. AlexBelo

    Stratched image is wrong if bmp dimention >32767 (RAD2007)

    Thank you for your response. Yes, I can create stretched bmp manually but for now I'd like to use a simple solution (if possible). > huge (more than a CD for a single image) Wow. Of course, you have no chance to process such picture with any thinkable API/hardware. My images are much smaller (like 2k*150k) but even them cause "Out of resourses". 🙂
  12. Hi all. I have a problem when I try to show a bmp in TImage when Image->Stratched=true. All work as expected when any bmp dimension is less than 32767. But higher dimensions lead to garbage in Image. Is this known limitation of WinAPI (can not find any in docs and Google) or bug in Graphics unit of RAD2007? TIA. -- Alex
  13. Hi all. Just for your information: IDE cannot find declaration with 32-bit clang compiler https://quality.embarcadero.com/browse/RSP-29732
  14. Hmm... Good option. 🙂 As documentation states: MapViewOfFile function (memoryapi.h) Maps a view of a file mapping into the address space of a calling process. So mapped view is in "my" address space. AFAIUI, OS gives me (and others who use the same mapped file) access to some "external" pages in memory but I see these pages as array allocated in "my" memory. And big view will take big continuous piece of virtual memory in my process. About TFileStream. As documentation states: ... file views derived from any file mapping object that is backed by the same file are coherent or identical at a specific time. Coherency is guaranteed for views within a process and for views that are mapped by different processes. (Not surprising: data resides in the same pages in memory.) AFAIUI "normal" files don't have such property.
  15. You are right in general when you say about direct manipulations with data in created view. But my main motivation here is standartization of data access with descendant of TStream.