from pathlib import Path from PIL import Image,ImageDraw,ImageFont import struct p=Path('C:/Amiga/HD0/Utilities/NewsTicker') h=bytearray(Path('C:/Amiga/HD0/System/Shell.info').read_bytes()[:78]) def u16(n):return struct.pack('>H',n) def u32(n):return struct.pack('>I',n&0xffffffff) h[12:16]=u16(48)+u16(40);h[16:18]=u16(6);h[48]=3 for off in (22,26):h[off:off+4]=u32(1) for off in (44,50,54,66,70):h[off:off+4]=u32(0) h[58:66]=u32(-1)+u32(-1);h[74:78]=u32(65536) data=bytearray(h) for selected in (False,True): im=Image.new('P',(48,40),0);d=ImageDraw.Draw(im) d.rounded_rectangle((2,1,45,35),radius=3,fill=2,outline=1 if selected else 3,width=2) for yy in (10,16,22,28):d.line((8,yy,39 if yy<28 else 28,yy),fill=1 if yy==10 else 3,width=2) d.line((6,32,41,32),fill=1);d.rectangle((18,36,30,38),fill=3) data+=u16(0)+u16(0)+u16(48)+u16(40)+u16(2)+u32(1)+bytes([3,0])+u32(0) for plane in range(2): for y in range(40): for x in range(0,48,8):data.append(sum((128>>i) if im.getpixel((x+i,y))&(1<