ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 m_segmentbuffer in iexVirtaulbitmaps is always NIL
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

harry stahl

Germany
62 Posts

Posted - Dec 21 2021 :  13:29:40  Show Profile  Reply
While your photosphere demo is working fine, I have problems to take it over in my application.

THere is an ImagenEnView (iView), that displays images (legay bitmap is used).

Now there is a 360% image, that I want to display. User can press a button to activate this. In onclick-Event I do the following:

iProvider.IO.LoadFromFile (fn);
iProvider.Update;

iview.IEBitmap.VirtualBitmapProvider := TIEEquirectangularRenderer.Create(iProvider);
iView.Update;

In the mousemoveEvent is your source. But app crashes, in unit iexVirtualbitmaps, in func "TIEEquirectangularRenderer.GetSegment", because m_segmentBuffer is NIL.

Is there a special setting neccessary, that this works also in my app?

edit: if I copy your template and use this, it works. But I create and use all my ImageEnview in this unit at runtime, so what special settings I have to set here?


HS

xequte

38611 Posts

Posted - Dec 21 2021 :  22:46:32  Show Profile  Reply
Hi Harry

Actually, it looks like GetSegment is not properly initialized (because it is not used by default).

Can you try changing iexVirtualBitmaps.pas as follows:

function TIEEquirectangularRenderer.GetSegment(Container: TIEBitmap; Row: integer; Col: integer; Width: integer): pointer;
...
begin
  if not assigned( m_segmentBuffer ) then
    m_segmentBuffer := TIEBitmap.Create();
  if (m_segmentBuffer.Width <> Width) or (m_segmentBuffer.Height <> 1) then
    m_segmentBuffer.Allocate(Width, 1);
...
end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: