Le 1 janv. 2012 à 00:15 Matin, Christian Schmitz a écrit:

> Am 31.12.2011 um 17:04 schrieb Arnaud Nicolet:
> 
>> I've searched at multiple places, but I haven't found a suitable answer. 
>> When I try to add a picture as the icon of a FolderItem, I get a -600 error 
>> code. That's weird because -600 means "the specified process couldn't be 
>> found" so my best guest is Mac OS X 10.7 no longer has a service to set the 
>> icon of a folderitem (?).
> 
> I have to correct me: 128/256/512 pixel wide icons work on Cocoa already.
> So the sample works here in general.
> 
> So can you send me off list some details what you do differently?

I'm not doing it on Cocoa currently (a complex project hardly runs fine there).
I've discovered something further: I get an error code of -600 but the icon is 
successfully added to the file. For example, this is the code I tried:

  dim b As BinaryStream
  dim f As FolderItem
  dim i As Integer
  dim p,m As Picture
  
  p=new Picture(128,128,32)
  m=new Picture(128,128,32)
  p.Graphics.UseOldRenderer=True
  m.Graphics.UseOldRenderer=True
  
  for i=0 to 62 step 2
    p.Graphics.DrawOval i,i,128-(i*2),128-(i*2)
    m.Graphics.DrawOval i,i,128-(i*2),128-(i*2)
  next
  f=SpecialFolder.UserHome.Child("Temp135")
  b=BinaryStream.Create(f)
  b.WriteLong 13579
  b.Close
  
  i=MakePreviewIconForFile(f,p,m)
  Break

Function MakePreviewIconForFile(File As FolderItem,p As Picture,m As Picture) 
As Integer
  dim fo as FolderItem
  dim g as IconFamilyMBS
  
  g=newIconFamilyMBS
  
  g.Thumbnail32BitData=p
  g.Thumbnail8BitMask=m
  
  g.Large1BitData=p
  g.Large1BitMask=m
  g.Large32BitData=p
  g.Large4BitData=p
  g.Large8BitData=p
  g.Large8BitMask=m
  
  g.Huge1BitData=p
  g.Huge1BitMask=m
  g.Huge32BitData=p
  g.Huge4BitData=p
  g.Huge8BitData=p
  g.Huge8BitMask=m
  
  g.Small1BitData=p
  g.Small1BitMask=m
  g.Small32BitData=p
  g.Small4BitData=p
  g.Small8BitData=p
  g.Small8BitMask=m
  
  return File.AddCustomIconMBS(g,False)
End Function

Do you also get i=-600?
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to