X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fswfoutput.cc;h=2161d9e3fed2e074857df4a99a4204a7030207d0;hb=602d0f0a1c8ad614029f235cc6ff38bfe26334e8;hp=0552bc557e8fd9a25737bf7983d4979be96624b7;hpb=9a9ca45befdb4dfdf1ec26535ccd05430877d5a1;p=swftools.git diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index 0552bc5..2161d9e 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -646,7 +646,7 @@ SWFFont::~SWFFont() swflastx=0; swflasty=0; - swf_SetU8(ftag,0x10); //0 fill bits, 0 linestyle bits + swf_SetU8(ftag,0x10); //1 fill bits, 0 linestyle bits SHAPE s; s.bits.fill = 1; s.bits.line = 0; @@ -1137,13 +1137,11 @@ void swfoutput_linktourl(struct swfoutput*obj, char*url, swfcoord*points) if(textid>=0) endtext(); - actions = swf_ActionStart(); if(opennewwindow) - action_GetUrl(url, "_parent"); + actions = action_GetUrl(0, url, "_parent"); else - action_GetUrl(url, "_this"); - action_End(); - swf_ActionEnd(); + actions = action_GetUrl(0, url, "_this"); + actions = action_End(actions); drawlink(obj, actions, 0, points,0); } @@ -1156,10 +1154,8 @@ void swfoutput_linktopage(struct swfoutput*obj, int page, swfcoord*points) if(textid>=0) endtext(); - actions = swf_ActionStart(); - action_GotoFrame(page); - action_End(); - swf_ActionEnd(); + actions = action_GotoFrame(0, page); + actions = action_End(actions); drawlink(obj, actions, 0, points,0); } @@ -1172,19 +1168,15 @@ void swfoutput_namedlink(struct swfoutput*obj, char*name, swfcoord*points) if(textid>=0) endtext(); - actions1 = swf_ActionStart(); - action_PushString("/:subtitle"); - action_PushString(name); - action_SetVariable(); - action_End(); - swf_ActionEnd(); - - actions2 = swf_ActionStart(); - action_PushString("/:subtitle"); - action_PushString(""); - action_SetVariable(); - action_End(); - swf_ActionEnd(); + actions1 = action_PushString(0, "/:subtitle"); + actions1 = action_PushString(actions1, name); + actions1 = action_SetVariable(actions1); + actions1 = action_End(actions1); + + actions2 = action_PushString(0, "/:subtitle"); + actions2 = action_PushString(actions2, ""); + actions2 = action_SetVariable(actions2); + actions2 = action_End(actions2); drawlink(obj, actions1, actions2, points,1); @@ -1351,23 +1343,28 @@ static void drawimage(struct swfoutput*obj, int bitid, int sizex,int sizey, if(y4>ymax) ymax=y4; if(x4linewidth,&obj->strokergb); //fsid = ShapeAddSolidFillStyle(shape,&obj->fillrgb); - fsid = swf_ShapeAddBitmapFillStyle(shape,&m,bitid,0); + fsid = swf_ShapeAddBitmapFillStyle(shape,&m,bitid,1); swf_SetU16(tag, myshapeid); r.xmin = (int)(xmin*20); r.ymin = (int)(ymin*20); @@ -1480,11 +1477,11 @@ int swfoutput_drawimagelossless(struct swfoutput*obj, RGBA*mem, int sizex,int si return bitid; } -int swfoutput_drawimagelossless256(struct swfoutput*obj, U8*mem, RGBA*pal, int sizex,int sizey, +int swfoutput_drawimagelosslessN(struct swfoutput*obj, U8*mem, RGBA*pal, int sizex,int sizey, double x1,double y1, double x2,double y2, double x3,double y3, - double x4,double y4) + double x4,double y4, int n) { TAG*oldtag; U8*mem2 = 0; @@ -1513,7 +1510,7 @@ int swfoutput_drawimagelossless256(struct swfoutput*obj, U8*mem, RGBA*pal, int s oldtag = tag; tag = swf_InsertTag(tag,ST_DEFINEBITSLOSSLESS2); swf_SetU16(tag, bitid); - if(swf_SetLosslessBitsIndexed(tag,sizex,sizey,mem, pal, 256)<0) { + if(swf_SetLosslessBitsIndexed(tag,sizex,sizey,mem, pal, n)<0) { swf_DeleteTag(tag); tag = oldtag; return -1;