ICO Transparent, geht aber nicht

Probleme beim Erstellen von 3D-Modellen und Texturen, keine Ahnung womit man Musik macht? Dies ist dein Forum.
Benutzeravatar
sen-me
Beiträge: 478
Registriert: 17.07.2005 16:02
Wohnort: Saarbrücken
Kontaktdaten:

ICO Transparent, geht aber nicht

Beitrag von sen-me »

also ich brauche .ico mit transparenten hintergrund.
ich hab mit photoshop 7 ein bild gemacht einmal mit transparenten und einmal ohne transparenten hintergrund.
beides habe ich dann mit ifran view zu ico gemacht.
doch der hintergrund wird nicht transparent.
ich habs mit "save transparent color" versucht und den hintergrund angeklickt, aber der wird dann nur etwas blasser O.o

gibts vll bei ico ein maximale farben? (8bit-16bit-24bit-32bit)
Bild
Benutzeravatar
vonTurnundTaxis
Beiträge: 2130
Registriert: 06.10.2004 20:38
Wohnort: Bayreuth
Kontaktdaten:

Beitrag von vonTurnundTaxis »

Nicht durch Zorn, sondern durch Lachen tötet man
ClipGrab | Pastor - jetzt mit kurzen URLs!
Sven
Beiträge: 374
Registriert: 23.09.2004 12:01

Beitrag von Sven »

Die Transparenz von IrfanView funktioniert nicht bei den Icons in PB. Ich nehme für die Icons IconEdit32, kann aber nur bis 256 Farben (V1.0). Kannst Du Bilder auch direkt aus Irfan reinkopieren (Copy&Paste).

Sven
Benutzeravatar
sen-me
Beiträge: 478
Registriert: 17.07.2005 16:02
Wohnort: Saarbrücken
Kontaktdaten:

Beitrag von sen-me »

vonTurnundTaxis hat geschrieben:Versuchs mal hiermit.

//Nachtrag:
Da die Herstellerseiter gerade offline zu sein scheint...
danke
Bild
Benutzeravatar
Macros
Beiträge: 1361
Registriert: 23.12.2005 15:00
Wohnort: Olching(bei FFB)
Kontaktdaten:

Beitrag von Macros »

Hier noch ein wunderschöner Code aus dem Englischen Forum,
Pb kanns schließlich auch :D

Code: Alles auswählen

; This Function creates 2 new Images out of the Icon.
; The Image specified in 'Image.l' will hold the Icon Image, and
; the one in 'Mask.l' will hold the Icon AND Mask. This is a Black&White
; Bitmap image, where all white parts are transparent in the Icon.
; All numbers here are PB #Image numbers.
Procedure SplittIcon(Icon.l, Image.l, Mask.l)
  UseImage(Icon)
  If CreateImage(Image, ImageWidth(), ImageHeight())
      DC.l = StartDrawing(ImageOutput())
      DrawIconEx_(DC, 0, 0, UseImage(Icon), 0, 0, 0, 0, 2)
    StopDrawing()
  EndIf
 
  If CreateImage(Mask, ImageWidth(), ImageHeight())
    DC.l = StartDrawing(ImageOutput())
      DrawIconEx_(DC, 0, 0, UseImage(Icon), 0, 0, 0, 0, 1)
    StopDrawing()
  EndIf
  UseImage(Image)
EndProcedure


; This Function creates a new Icon, out of the Images specified in Image and Mask.
; Both must be of the same size, and the Mask may only contain black and white.
Procedure.l CreateIcon(Icon.l, Image.l, Mask.l)
  Protected *Bitmap.LONG
 
  UseImage(Image)
  CreateImage(Icon, ImageWidth(), ImageHeight()) 
  !extrn _PB_Image_CurrentObject
  !mov eax, [_PB_Image_CurrentObject]
  !mov [esp+12], eax
 
  DeleteObject_(*Bitmap\l)
 
  NewIcon.ICONINFO
  NewIcon\fIcon = #True
  NewIcon\hbmMask = UseImage(Mask)
  NewIcon\hbmColor = UseImage(Image)
  *Bitmap\l = CreateIconIndirect_(@NewIcon)
 
  ProcedureReturn UseImage(Icon)
EndProcedure





#Icon  = 0
#Image = 1
#Mask  = 2

Font.l = LoadFont(0, "Times", 8)

If OpenWindow(0, 0, 0, 100, 50, #PB_Window_SystemMenu|#PB_Window_ScreenCentered, "Icon")
  If CreateGadgetList(WindowID())

    ; Create and draw the Icon Image:
    CreateImage(#Image, 16, 16)   
    StartDrawing(ImageOutput())     
      DrawingMode(1)
      FrontColor($FF, $00, $00)
      Locate(2, 2)
      DrawingFont(Font)
      DrawText("PB")     
    StopDrawing()
   
    ; See the result:
    ImageGadget(1, 20, 20, 32, 32, ImageID())
   
    ; Create and draw the mask. Everything that is white
    ; will be transparent, everything black will be displayed.
    ; so we just draw the same as above in black on a white background.
    CreateImage(#Mask, 16, 16)   
    StartDrawing(ImageOutput())
      Box(1, 1, 14, 14, $FFFFFF)
      FrontColor($00, $00, $00)     
      DrawingMode(1)     
      Locate(2, 2)
      DrawingFont(Font)
      DrawText("PB")   
    StopDrawing()
   
    ; Yet another test:
    ImageGadget(1, 60, 20, 32, 32, ImageID())
   
    ; Now we make our new #Icon out of these 2...
    CreateIcon(#Icon, #Image, #Mask)
   
    ; And place it in the systray.
    AddSysTrayIcon(0, WindowID(), ImageID())
   

    Repeat
    Until WaitWindowEvent() = #PB_EventCloseWindow
  EndIf
EndIf
End
Kaeru Gaman
Beiträge: 17389
Registriert: 10.11.2004 03:22

Beitrag von Kaeru Gaman »

Macros hat geschrieben:Pb kanns schließlich auch :D
nö.. API does it... steht doch da.. drei pointer verbiegen, und rüber zu API schieben...
Der Narr denkt er sei ein weiser Mann.
Der Weise weiß, dass er ein Narr ist.
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Beitrag von ts-soft »

>> nö.. API does it... steht doch da
Alles API, gewrapped und ungewrapped :mrgreen:
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Antworten