@Krashan, post #2
@Krashan, post #11
GetDTAttrs()
SetRGB32()
If FromCLI
If NumPars<>1 Then End
f$=Par$(1)
Else
End
EndIf
DEFTYPE.IntuitionBase *iBase
DEFTYPE.Screen *scr
DEFTYPE.DrawInfo *di
DEFTYPE._Object *dto
DEFTYPE.DataType *dtn
DEFTYPE.DataTypeHeader *dth
DEFTYPE.BitMapHeader *bmhd
DEFTYPE.BitMap *bm
DEFTYPE.gpLayout gpl
DEFTYPE.l suc
DEFTYPE.l lock
DEFTYPE.l *cr
;----------------- znajdz WB ----------------------------------------
*iBase = IntuitionBase
lock = LockIBase_(0)
*scr = *iBase\FirstScreen
While *scr
If (*scr\Flags)&#SCREENTYPE=#WBENCHSCREEN
Pop While
Goto jump_00
EndIf
*scr=*scr\NextScreen
Wend
End;nie ma wb
jump_00:
UnlockIBase_(lock)
; -----------------------------------------------------------------------------
Dim tags.TagItem(5)
tags(0)\ti_Tag = #DTA_SourceType ,#DTST_FILE
tags(1)\ti_Tag = #DTA_GroupID ,#GID_PICTURE;zamiast IF + GetDTString_(*dth\dth_GroupID)
tags(2)\ti_Tag = #PDTA_Remap ,False
tags(3)\ti_Tag = #PDTA_Screen ,*scr
tags(4)\ti_Tag = #TAG_DONE ,0
*dto=NewDTObjectA_(&f$, &tags(0))
If *dto
*lock = Lock_(f$,#ACCESS_READ) ;moge tez dac & z przodu ale nie * dla czystego textu
*dtn = ObtainDataTypeA_(#DTST_FILE,*lock,#TAG_DONE)
*dth = *dtn\dtn_Header
ReleaseDataType_(*dtn)
UnLock_(lock)
gpl\MethodID=#DTM_PROCLAYOUT,0,1
suc=DoDTMethodA_(*dto,0,0,&gpl)
tags(0)\ti_Tag = #PDTA_BitMapHeader ,&*bmhd
tags(1)\ti_Tag = #PDTA_BitMap ,&*bm
tags(2)\ti_Tag = #PDTA_CRegs ,&*cr
tags(3)\ti_Tag = #TAG_DONE ,0
suc=GetDTAttrsA_(*dto,&tags(0))
bmd.b=*bmhd\bmh_Depth
*di=GetScreenDrawInfo_(*scr)
scd.b=*di\dri_Depth
If bmd>scd Then bmd=scd
i.b=0
While i<bmd^2
suc=SetRGB32_(*scr\ViewPort,i,Peek.l(*cr+i*12+0),Peek.l(*cr+i*12+4),Peek.l(*cr+i*12+8))
i+1
Wend
DisposeDTObject_(*dto)
EndIf
End@peceha, post #12
@cholok, post #13
In general, you don't need to open libraries explicitly for using OS calls - Blitz will open and close them as required (but be sure to use the End statement to exit the program). However, you *can* open and close the libraries yourself manually if you like, which could be done to check that the correct library is available for example and handle a failure appropriately. Using a function that doesn't exist in a library (e.g. a V39 call when running on V36) will result in a crash if you don't manually check the library yourself and avoid the call.
@peceha, post #12
@peceha, post #18
@Hexmage960, post #19
@peceha, post #21
Czy po uzyciu jednej z tych komend kolory powinny sie natychmiast zmienic czy musze jeszce cos wykonac by ekran dostal nowe kolory?
Wykonuje ObtainBestPenA() ale efektu nie widze...
@peceha, post #23
@peceha, post #25
@Hexmage960, post #27
i.b=0
While i<bmd^2
suc=ObtainPen_(*scr\ViewPort\ColorMap,i,Peek.l(*cr+i*12+0),Peek.l(*cr+i*12+4),Peek.l(*cr+i*12+8),0) ;lub #PEN_EXCLUSIVE
i+1
Wend@peceha, post #28
@Hexmage960, post #29