Re: Antwort: Loading .png Assets

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Loading .png Assets

Stew MacLean
Message
Hi Tom,
 
I was trying to figure out how the "Assets" got loaded, but it's via a package from Store "Assets-IDE" - thanks Karsten (& Travis!).
 
Thanks for the code snippet on how to load a .png, useful also.
 
Cheers,
 
Stewart
 
-----Original Message-----
From: Tom Gruenewald [mailto:[hidden email]]
Sent: 22 November 2013 10:12 p.m.
To: [hidden email]
Subject: Antwort: [vwnc] Loading .png Assets

Hello Mr. MacLean,
I am not sure what you are looking for. I am loading PNG files the following way.


load: absoluteFilename

| imageReader image |
imageReader := [ImageReader fromFile: absoluteFilename] on: Error do: [:exception | exception return: nil].
imageReader isNil ifTrue: [^nil].
image := [AlphaCompositedImage image: imageReader image] on: Error do: [:exception | exception return: nil].
image isNil ifTrue: [^nil].
^image


Best regards,
Tom Grünewald

________

Carl Zeiss Industrielle Messtechnik GmbH
Softwareentwicklung/Software Development

T o m   G r ü n e w a l d

73446 Oberkochen, Germany
tel: +49.7364.20-8541
fax: +49.7364.20-4800
email: [hidden email]
http://www.zeiss.de/imt

Carl Zeiss Industrielle Messtechnik GmbH
Carl-Zeiss-Straße 22, 73447 Oberkochen
Vorsitzender des Aufsichtsrates: Dr. Hermann Gerlinger
Geschäftsführer: Dr. Rainer Ohnheiser (Vorsitzender), Felix Hoben, Harald Klaiber
Sitz der Gesellschaft: 73446 Oberkochen, Deutschland
Handelsregister: Amtsgericht Ulm, HRB 501561
USt-IdNr.: DE 811 515 346

" src="cid:093573310@22112013-1670" width=16 height=16>Stewart MacLean <[hidden email]>



An


Kopie


Thema

    [vwnc] Loading .png Assets

Hi,
 
I've got some .png files that I'd like to use and have come across the Assets class.
 
I get that there is a pragma pointing to a file and that the files get coverted into a method which can be used without the file to get the .png image.
 
I'd like to "load" some .pngs but the class documentation doesn't explain how.
 
Pointers appreciated...
 
Thanks,
 
Stewart_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



----------------------------------------
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

graycol.gif (144 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Loading .png Assets bug

Stew MacLean
Message
Hi,
 
Thanks all for the help with loading Assets.
 
FYI, I found that I had to check for nil attributeMessages...
 
checkForExtraneousAssets: aCollectionOfImports
 
 | stowaways victims change |
 stowaways := (self selectedClass classBehavior methodDictionary values reject: [: each | each attributeMessages isNil])
    select: [:each | each attributeMessages anySatisfy: [:tag | tag selector = #file:]].
 stowaways
  removeAll: (aCollectionOfImports collect: [:each | each assetMethod]).
 stowaways isEmpty ifTrue: [^self].
 victims := self
    promptForAssetMethodsToRemove: (stowaways
      collect: [:each | each definition]) asSortedCollection.
 victims isEmpty ifTrue: [^self].
 change := CompositeRefactoryChange new.
 victims
  do: [:each | change removeMethod: each selector from: each implementingClass].
 self performChange: change
-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Stewart MacLean
Sent: 22 November 2013 11:38 p.m.
To: 'Tom Gruenewald'; [hidden email]
Subject: Re: [vwnc] Antwort: Loading .png Assets

Hi Tom,
 
I was trying to figure out how the "Assets" got loaded, but it's via a package from Store "Assets-IDE" - thanks Karsten (& Travis!).
 
Thanks for the code snippet on how to load a .png, useful also.
 
Cheers,
 
Stewart
 
-----Original Message-----
From: Tom Gruenewald [mailto:[hidden email]]
Sent: 22 November 2013 10:12 p.m.
To: [hidden email]
Subject: Antwort: [vwnc] Loading .png Assets

Hello Mr. MacLean,
I am not sure what you are looking for. I am loading PNG files the following way.


load: absoluteFilename

| imageReader image |
imageReader := [ImageReader fromFile: absoluteFilename] on: Error do: [:exception | exception return: nil].
imageReader isNil ifTrue: [^nil].
image := [AlphaCompositedImage image: imageReader image] on: Error do: [:exception | exception return: nil].
image isNil ifTrue: [^nil].
^image


Best regards,
Tom Grünewald

________

Carl Zeiss Industrielle Messtechnik GmbH
Softwareentwicklung/Software Development

T o m   G r ü n e w a l d

73446 Oberkochen, Germany
tel: +49.7364.20-8541
fax: +49.7364.20-4800
email: [hidden email]
http://www.zeiss.de/imt

Carl Zeiss Industrielle Messtechnik GmbH
Carl-Zeiss-Straße 22, 73447 Oberkochen
Vorsitzender des Aufsichtsrates: Dr. Hermann Gerlinger
Geschäftsführer: Dr. Rainer Ohnheiser (Vorsitzender), Felix Hoben, Harald Klaiber
Sitz der Gesellschaft: 73446 Oberkochen, Deutschland
Handelsregister: Amtsgericht Ulm, HRB 501561
USt-IdNr.: DE 811 515 346

" src="cid:109244102@30112013-167E" width=16 height=16>Stewart MacLean <[hidden email]>



An


Kopie


Thema

    [vwnc] Loading .png Assets

Hi,
 
I've got some .png files that I'd like to use and have come across the Assets class.
 
I get that there is a pragma pointing to a file and that the files get coverted into a method which can be used without the file to get the .png image.
 
I'd like to "load" some .pngs but the class documentation doesn't explain how.
 
Pointers appreciated...
 
Thanks,
 
Stewart_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



----------------------------------------
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

graycol.gif (144 bytes) Download Attachment