Update for "Couple of problems with built and installed App"

I have a different problem with the XOJO logo and being built.
The image showed up on the built app, but now it isn’t. The function works elsewhere in the built app, so I know it works.
It shows up of course in the debug version.

https://forum.xojo.com/t/couple-of-problems-with-built-and-installed-app/67597/7

How do I debug for this problem?

The image on a Mac build doesn’t show. On windows, only a portion of the icon shows.

I don’t know how to check what is going on, since I get NO NOE’s or any kind of error.

I know the file has been copied to the resource folder as have the HelpFiles, which works. So does the app’s icon.

Line by line.
Do you have a sample project that displays this? (the feedback case sounds like it may only be a sample for DLL files issue)

This only shows in the built app. I’ll work one up

grumble. I feel betrayed by …
The code I’ve had has never thrown an NOE. I’ve ran this function thousands of times and it never failed. Now that I put it in its own project, I have for the constructor for graphics.DrawPicture a negative number and it’s slways been there. Grumble

I’m posting this because I feel embarrassed. I try to figure it out.
The call for my function ScalePicture is

AbtMWXIcon.Image = App.ScalePicture( xImgPic, AbtMWXIcon.Width, AbtMWXIcon.Height)

AbtMWXIcon is the future image.

The line with the NOE is
p2.Graphics.DrawPicture PictureToScale, (Availablewidth-neww)\2, (Availableheight-newh)\2, neww, newh, 0, 0, w, h

The function:

ScalePicture (PictureToScale As Picture, Availablewidth As Integer, Availableheight As Integer)

// Now Scale the image
try
  'Var p2 as Picture
  Var d as double
  Var w, h, neww, newh as integer
  w = PictureToScale.width
  h = PictureToScale.height
  d = min( Availablewidth/w,Availableheight/h ) // Calculate the factor with which to scale
  neww = w*d // the new width of the picture
  newh = h*d // the new height of the picture
  Var p2 as Picture = new Picture( Availablewidth, Availableheight, PictureToScale.Depth )
  p2.Graphics.DrawPicture PictureToScale, (Availablewidth-neww)\2, (Availableheight-newh)\2, neww, newh, 0, 0, w, h
  return p2
Catch err As OutOfMemoryException
  #If TargetWindows Then
    bmsg = New BoxMssage( 0, "Insufficient memory to draw the picture!", "", CurrentMethodName )
  #Else
    MessageBox("Insufficient memory to draw the picture!")
  #EndIf
  Return Nil
Catch err As NilObjectException
  #If TargetWindows Then
    bmsg = New BoxMssage( 0,  "The Picture Cannot be Used Because of " + err.ErrorNumber.ToText, "Picture", CurrentMethodName )
  #Else
    MessageBox("The Picture Cannot be Used Because of " + err.ErrorNumber.ToText)
  #EndIf
  Return Nil
Catch err As UnsupportedFormatException
  #If TargetWindows Then
    bmsg = New BoxMssage( 0,  "The Picture Cannot be Used Because of " + err.ErrorNumber.ToText, "Picture", CurrentMethodName )
  #Else
    MessageBox("The Picture Cannot be Used Because of ")
  #EndIf
  Return Nil
End Try
//Graphics.DrawPicture(Image As Picture, x As Double, y As Double [,destWidth As Double ] [, destHeight As Double ]
// [, sourceX As Double ] [, sourceY As Double ] [, sourceWidth As Double ] [, sourceHeight As Double])

No need to apologise.
Isolating the problem like this is a perfectly valid debugging technique.

I try to figure it out.

So, have you fixed it , or are you looking for help with this code?

Not yet. Doing 3 things at once

I don’t get it. When I run numbers they are good and shouldn’t; fail. I am uploading a Zip of my About Box with the notes from my numbers. I would like to know what’s wrong please.

https://www.dropbox.com/s/zpvq1yvhe4b26ls/About%20Box.zip?dl=0

So I suspect that what’s going on is that this is failing when picture depth < 32. None of our current platforms actually support that any more and it may be that p2 comes back nil.

Thanks. It works. I changed the Picture constructor line to
Var p2 as Picture = new Picture( Availablewidth, Availableheight)

It works but doesn’t fill the box.

The constructors don’t mention depth. I wonder when that depth disappeared.

Edit: 2011R2 does have depth in the constructor.

The LR does mention bitmaps() but no explanation.

Also the depth was 0.

So, what are bitmaps()? I couldn’t find anything under

Pictures created using this constructor have their Type set to Types.Image.

Ran out of time during edit.

Also the depth was 0, so this became Types Image or did it call the deprecated constructor (depr. 2020R2)

So, 2 questions.

Is there a good explanation of image types?

Which constructor did it call deprecated or current?

https://documentation.xojo.com/topics/graphics/hidpi_support.html