[PureBasic 4.20 B2] POLINK-Error bei AlphaBlend

Hier werden, insbesondere in den Beta-Phasen, Bugmeldungen gepostet. Das offizielle BugForum ist allerdings hier.
Benutzeravatar
legion
Beiträge: 467
Registriert: 08.10.2006 18:04
Computerausstattung: Intel Core i5-6500 @ 4x 3.6GHz mit Windows 10 Pro, Intel Core-i7 mit Ubuntu 18.04 bionic, x86_64 Linux 4.18.0-16-generic, Microsoft Surface Pro - Windows 10 Pro
Wohnort: Wien
Kontaktdaten:

[PureBasic 4.20 B2] POLINK-Error bei AlphaBlend

Beitrag von legion »

Hallo !

Mir ist aufgefallen, dass einige alte Programme die "AlphaBlend" aus der
"Msimg32.lib" nutzen nicht mehr funktionieren. :cry:

Beim Start kommt der Fehler:
POLINK:error:Unresolved external symbol '_AlphaBlend'.

Lg. Legion


Beispiel funktioniert bis PB4.02 ohne Probleme:

Code: Alles auswählen

Import "Msimg32.lib" 
  AlphaBlend(dc1, x1, y1, w1, h1, dc2, x2, y2, w2, h2, blend) 
EndImport 

Global blend.l

*blend.BLENDFUNCTION = @blend 
*blend\SourceConstantAlpha = 128

Procedure.l DrawAlphaImage2(hdc, image, x, y, Alpha) 
  TempDC = CreateCompatibleDC_(hdc) 
  If TempDC 
    object = SelectObject_(TempDC, ImageID(image)) 
    If object 
      w = ImageWidth(image) 
      h = ImageHeight(image) 
       
      AlphaBlend(hdc, x, y, w, h, TempDC, 0, 0, w, h, blend) 
      DeleteObject_(object) 
    EndIf 
    DeleteDC_(TempDC) 
  EndIf 
EndProcedure 

For i = 1 To 10 
  If CreateImage(i, Random(50)+50, Random(50)+50) 
    If StartDrawing(ImageOutput(i)) 
      Box(0, 0, ImageWidth(i), ImageHeight(i), RGB(Random(255), Random(255), Random(255))) 
      StopDrawing() 
    EndIf 
  EndIf 
Next i 

If OpenWindow(0, 0, 0, 400, 300, "AlphaBlend", #PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
  
  WinHDC = StartDrawing(WindowOutput(0)) 
  
  If WinHDC 
    For i = 1 To 100 
      For j = 1 To 10 
        DrawAlphaImage2(WinHDC, j, Random(375), Random(275), i) 
      Next j 
      WindowEvent() 
      Delay(20) 
    Next i 
  EndIf 
  
  StopDrawing() 

  Repeat 
  Until WaitWindowEvent()=#PB_Event_CloseWindow 

EndIf 
PB 5.71 LTS Windows 10 Pro & Ubuntu 18.04.2 LTS & Linux Mint 19.3
-----------------------------------------------------
Alles ist, wie man glaubt, dass es ist!