Re: 2 different results fro the same code!

Jean-Luc Arnaud <jean-luc-E/[email protected]> Tue, 29 Aug 2017 18:27:40 +0200
Newsgroups gmane.comp.lang.realbasic.user
Organization Centre Direct du Multimédia
Message-ID <[email protected]>
In addition, I just tested to open the .ico file SourceFile in a 
MemoryBlock in both projects, the content is the same!

So, in the first project, Picture.Open(SourceFile) returns a Picture 
containing 4 icons, as expected (16x16, 32x32, 48x48 and 256x256).
In the second, it returns only the first icon, that is the 16x16 one.

Any explanation?

Thanks

JL Arnaud


---------------------
Hi all,

I'm used to test some codes in little test apps before using these codes 
in main apps.

Today, I'm facing a very strange issue.

I'm opening a ".ico" file using:

   If SourceFile.NameExtensionMBS="ico" Then
     p=Picture.Open(SourceFile)

     ...

In my little test app, after the second line, p (defined as a global 
property of type "Picture) has a depth property of 0, Graphics Nil, 
ImageCount 4 And

     p=p.BestRepresentation(MyCanvas.Width,MyCanvas.Height,1)

returns the expected result, that is, the icon matching the closest 
properties of MyCanvas.

Now, the same code with the same p property, in my main project, returns 
a p object with a depth property to 32, Graphics not nil, ImageCount to 0

and a p.BestRepresentation returning always a 16x16 icon, of course with 
the same SourceFile.

The p property is not instantiated, a break point on the second line in 
both projects shows a nil p property.

I don't understand what's happening, so any idea, help, suggestion, 
exorcism is welcome.

TIA

-- 
Jean-Luc Arnaud




To unsubscribe, email [email protected]