[erledigt] Image-Hintergrund transparent statt schwarz ?
Verfasst: 14.02.2008 13:31
moin, moin...
Meine Suchschwäche führt mal wieder nicht zum Ziel
Was muß ich ändern, damit der Gitter-Hintergrund transparent wird und ich den Text sehen kann ?
@Fluid:
mit dem bitblt_() komm ich nich klar, deswegen habbichs so versucht.
mDv... scholly
Meine Suchschwäche führt mal wieder nicht zum Ziel

Was muß ich ändern, damit der Gitter-Hintergrund transparent wird und ich den Text sehen kann ?
Code: Alles auswählen
#main_win = 0
#main_win_width = 660
#main_win_height = 230
#text_image = 1
#text_image_Gadget = 2
#gitter_image = 3
#gitter_image_Gadget = 4
#image_width = 640
#image_height = 200
#spingadget_4_height = 5
#spingadget_4_width = 6
#text_gadget_height = 7
#text_gadget_width = 8
Procedure change_gitter()
HideGadget(#gitter_image_Gadget,1)
If StartDrawing(ImageOutput(#gitter_image))
Box(0, 0, #image_width, #image_height)
DrawingMode(#PB_2DDrawing_Transparent)
x_start = 0
While x_start < #image_width
x_start + GetGadgetState(#spingadget_4_width)
Line(x_start, 0, 0, #image_height, RGB(255,255,255))
Wend
y_start = 0
While y_start < #image_height
y_start + GetGadgetState(#spingadget_4_height)
Line(0,y_start, #image_width,0, RGB(255,255,255))
Wend
StopDrawing()
EndIf
SetGadgetText(#spingadget_4_height, Str(GetGadgetState(#spingadget_4_height)))
SetGadgetText(#spingadget_4_width, Str(GetGadgetState(#spingadget_4_width)))
HideGadget(#gitter_image_Gadget,0)
EndProcedure
If OpenWindow(#main_win, 100, 200, #main_win_width, #main_win_height, "Font Gitter Test")
LoadFont(1, "FixedSys", 32)
If CreateImage(#text_image, #image_width, #image_height)
If StartDrawing(ImageOutput(#text_image))
DrawingFont(FontID(1))
DrawingMode(#PB_2DDrawing_Transparent)
FrontColor(RGB(255,0,0))
DrawText(0,0,"Hello, this is a test")
StopDrawing()
EndIf
EndIf
If CreateImage(#gitter_image, #image_width, #image_height)
If StartDrawing(ImageOutput(#gitter_image))
DrawingMode(#PB_2DDrawing_Transparent)
x_start = 0
While x_start < #image_width
x_start + 20
Line(x_start, 0, 0, #image_height, RGB(255,255,255))
Wend
y_start = 0
While y_start < #image_height
y_start + 20
Line(0,y_start, #image_width,0, RGB(255,255,255))
Wend
StopDrawing()
EndIf
EndIf
CreateGadgetList(WindowID(#main_win))
TextGadget (#text_gadget_height, 0, 3, 30, 20,"Höhe:")
SpinGadget (#spingadget_4_height, 35, 0, 50, 20, 0, 100)
SetGadgetState (#spingadget_4_height, 20) : SetGadgetText(#spingadget_4_height, "20")
TextGadget (#text_gadget_width, 120, 3, 40, 20,"Breite:")
SpinGadget (#spingadget_4_width, 155, 0, 50, 20, 0, 100)
SetGadgetState (#spingadget_4_width, 20) : SetGadgetText(#spingadget_4_width, "20")
ImageGadget(#text_image_Gadget, 0, 25, 0, 0, ImageID(#text_image))
ImageGadget(#gitter_image_Gadget, 0, 25, 0, 0, ImageID(#gitter_image))
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
EventGadgetID = EventGadget()
Select EventGadgetID
Case #spingadget_4_height : change_gitter()
Case #spingadget_4_width : change_gitter()
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
EndIf
End
mit dem bitblt_() komm ich nich klar, deswegen habbichs so versucht.
mDv... scholly