]>
Commit | Line | Data |
---|---|---|
c1f0ee65 JR |
1 | As pointed out by long-time Friend-of-XV Rick Dyson, the XV 3.10a does an |
2 | unexpected thing if you crop an image, and then 'pad' it. 3.10a would | |
3 | effectively 'UnCrop' the image first, then pad it. There is a workaround | |
4 | (save and reload the cropped image), but that's every bit as tedious as it | |
5 | sounds. | |
6 | ||
7 | This should do the trick, with any luck. | |
8 | ||
9 | --jhb, 7/9/98 | |
10 | ||
11 | ||
12 | ||
13 | ||
14 | *** xvimage.c.old Fri Jul 10 01:18:07 1998 | |
15 | --- xvimage.c Fri Jul 10 01:21:57 1998 | |
16 | *************** | |
17 | *** 2530,2536 **** | |
18 | ||
19 | rv = 1; | |
20 | ||
21 | ! if ((mode != PAD_LOAD) && (wide == pWIDE && high == pHIGH && opaque==100)) { | |
22 | ErrPopUp("Padding to same size as pic while fully opaque has no effect.", | |
23 | "\nI see"); | |
24 | return 0; | |
25 | --- 2530,2536 ---- | |
26 | ||
27 | rv = 1; | |
28 | ||
29 | ! if ((mode != PAD_LOAD) && (wide == cWIDE && high == cHIGH && opaque==100)) { | |
30 | ErrPopUp("Padding to same size as pic while fully opaque has no effect.", | |
31 | "\nI see"); | |
32 | return 0; | |
33 | *************** | |
34 | *** 2806,2832 **** | |
35 | ||
36 | /* copy 'pic' centered onto pic24. */ | |
37 | ||
38 | ! sx = (wide - pWIDE) / 2; | |
39 | ! sy = (high - pHIGH) / 2; | |
40 | ||
41 | ! for (py = 0; py<pHIGH; py++) { | |
42 | ! ProgressMeter(0, pHIGH-1, py, "Pad"); | |
43 | if ((py & 0x1f)==0) WaitCursor(); | |
44 | ||
45 | p24y = sy + py; | |
46 | if (p24y >= 0 && p24y < high) { | |
47 | ! for (px=0; px<pWIDE; px++) { | |
48 | p24x = sx + px; | |
49 | if (p24x >= 0 && p24x < wide) { | |
50 | p24 = pic24 + (p24y*wide + p24x)*3; | |
51 | ||
52 | ||
53 | if (picType == PIC24) { /* src is PIC24 */ | |
54 | ! pp = pic + (py * pWIDE + px) *3; | |
55 | r = pp[0]; g = pp[1]; b = pp[2]; | |
56 | } | |
57 | else { /* src is PIC8 */ | |
58 | ! pp = pic + (py*pWIDE + px); | |
59 | r = rMap[*pp]; g = gMap[*pp]; b = bMap[*pp]; | |
60 | } | |
61 | ||
62 | --- 2806,2832 ---- | |
63 | ||
64 | /* copy 'pic' centered onto pic24. */ | |
65 | ||
66 | ! sx = (wide - cWIDE) / 2; | |
67 | ! sy = (high - cHIGH) / 2; | |
68 | ||
69 | ! for (py = 0; py<cHIGH; py++) { | |
70 | ! ProgressMeter(0, cHIGH-1, py, "Pad"); | |
71 | if ((py & 0x1f)==0) WaitCursor(); | |
72 | ||
73 | p24y = sy + py; | |
74 | if (p24y >= 0 && p24y < high) { | |
75 | ! for (px=0; px<cWIDE; px++) { | |
76 | p24x = sx + px; | |
77 | if (p24x >= 0 && p24x < wide) { | |
78 | p24 = pic24 + (p24y*wide + p24x)*3; | |
79 | ||
80 | ||
81 | if (picType == PIC24) { /* src is PIC24 */ | |
82 | ! pp = cpic + (py * cWIDE + px) *3; | |
83 | r = pp[0]; g = pp[1]; b = pp[2]; | |
84 | } | |
85 | else { /* src is PIC8 */ | |
86 | ! pp = cpic + (py*cWIDE + px); | |
87 | r = rMap[*pp]; g = gMap[*pp]; b = bMap[*pp]; | |
88 | } | |
89 |