As some of you may have noticed, attaching large images breaks the phpBB layout.
[DSC00580.JPG left]There is a way to make the "phpBB attachment MOD" do thumbnails, but I didn't like the way attachments get all their meta-info displayed. Nice for zip files and the like, not for images. They should be a natural part of the layout.
Luckily I had some code lying around I wrote for the school website I built a while ago. At that site we use phpBB as a sort of content management system, and the code allows for some flexibility when attaching images.
From now on, if you attach an image, you can give it a place in your message by enclosing the name in square brackets anywhere. So if you attach an image called 'DSC000237.jpg' then if you put '[dsc000237.jpg]' in the text, this gets replaced with the image. (The name is not case sensitive). The image will be resized if it is wider than 500 pixels, clickable for those that want to see the original image. Unless you put 'noframe' after it (i.e. '[dsc000237.jpg noframe]' ), the image will be placed inside a narrow white frame that also holds the attachment description.
[DSC00579.JPG]
If you say '[dsc000237.jpg left]' or '[dsc000237.jpg right]', the image will be inserted to the left or the right of the text flow, and resized to be 200 pixels wide. Again, you can add 'noframe' after the left or right to make the frame disappear.
Any images not mentioned in the text get shown at the bottom of the message, two side by side.
I've added a few pictures with this message so you get the idea. For the curious: it's a school in Eastern Germany, redesigned by Friendensreich Hundertwasser.
Peter Poelman said:
I've added a few pictures with this message so you get the idea. For the curious: it's a school in Eastern Germany, redesigned by Friendensreich Hundertwasser.
Click to expand...
Click to collapse
Oh, are you from Wien?
his flag leads one to believe that he's dutch
a picture is worth 1024 WORD's
or 512 DWORD's if you pref
Rudegar said:
his flag leads one to believe that he's dutch
a picture is worth 1024 WORD's
or 512 DWORD's if you pref
Click to expand...
Click to collapse
It's a Hundertwasser house that's why ...
How many posts do have to have to post an image?
hi,
i wanted to create my own background-theme, and this thread was very helpful:
http://forum.xda-developers.com/showpost.php?p=3062019&postcount=54
(you need the Background4AllTabs "5c9aa261_manila" & "4a087e41_manila" from NisseDILLIGAF)
the problem was, i had a circle in the picture, and every time it was stretched or squashed, wrong aspect ratio, not fitting well. so i did a little research myself - pixelcounting fun.
conclusion:
1. crop your original-pic (maybe 800x480) to 700x480 (the real background size, 50 px from the top and 50 px from bottom)
2. create an new empty 512x512 file
3. resize your 700x480-pic to 512x460, squash squash squash (!)
4. paste it in the empty 512x512 on the left side(!) leaving an empty unused bar of 52px on the right side
5. do all steps from the link above to convert it for manila
nothing stretched or squashed anymore. full circles.
FINAL note:
this method works only for NisseDILLIGAF's *5c9aa261_manila* that came from the diamond. it works, but it also has the blackhole problem.
bbonzz's method (look below) works for http://forum.xda-developers.com/showpost.php?p=3068310&postcount=60 (blackhole solution).
both have no problems with nocurtains-mod. baah, too much confusion about the manila files...
Actually the background is 480x636 (image 1), because of the top curtain hole in background4alltabs.
So, to keep the aspect ratio, what you have to do is more simple:
1) cut you 480x800 (image 2) to 480x636 (image 3) keeping 52 px from bottom (bottom bar) and 112 from top (top bar+top curtain)
2) stretch to 460x512 (image 4)
3) add a 52px transparent (or whatever: black, white... It will be invisible anyway) canvas to the right (image 5)
voilĂ , you have a pic for Manila Editor, and once installed on Blackstone, Manila will resize it back to the original 480x636, without distortion and without shifting a single pixel. You can verify this by using the original 480x800 as background for the home tab (image 1): switching tabs, you'll notice the image is still the same: no movements, no distortions.
do you guys have a problem with a black hole at the top of the background in sound settings on the settings tab ?
check this!
hi bbonzz,
i tried your version and it does not match. check the attachment.
manila stretched the logo and it ended up as an egg.
the best way is to compare the original (800x480) as homescreen-background against the manila version background in the other tabs. that was the game i was playing. after several try&errors i found it. the mapping-coordinates for the manila-background in my tf3d background4alltabs is 700x480. 50px less reserved for the top-taskbar and 50px less reserved for the softbutton-bar at the bottom.
manila stretches the left space of the 512x512 texture (512x460) to 700x480 perfectly and the aspect ratio of the original is back.
by the way, the black hole is still a problem, but doesn't bother me.
maybe it depends on which 5b9aa261 are you using: on my HD (with the "corrected and not the original 5b9aa261), using the same try&error way, i have the perfect fit with the 480x636 thing, as you see in the screenshot. Later i'll try with your attachment
ok, i forgot to mention that "nocurtains" is installed on my hd. maybe thats the reason why you got 636 px instead of 700 px.
4a087e41_manila
Hi sir AlecDelorean and other member can you make me a 4a087e41_manila with my attach file, thanks advanced...
please test this
hi p_elmenzo,
do yo have the 2 files from background4alltabs already installed?
if yes, here you go. don't forget to backup you original manila files.
don't blame me if something goes wrong
and please compare your original pic as background for the homescreen against the new background in the other tabs. if anything moves, or looking stretched, send me a screenshot.
4a087e41_manila
Thank you very much AlecDelorean...
Grazie Mille AlecDelorean...
4a087e41_manila
Hi, again AlecDelorean i have a small problem when i change my tab the background image has change maybe the pixel of the image.
i know, its a problem of the image-compression/conversion in manila-editor. when i have time, i add a little grain in photoshop to trick the compression-algorithm.
4a087e41_manila
Ok Thanks a lot...
here you go again
ok, did some tests. i don't know much about the converting process of the manila editor, but it seems it reduces a lot of bandwidth of the colorspace combined with very rude compression. so by example - gradients loose a lot of quality, instead of other more colorful pictures where the difference of every neighbor pixel is higher. maybe its the 3d-texture method htc is using, they try to save as much memory as they can. an interesting thing to notice (compare your screenshots with the original pic), there is an converting-process included in tf3d by itself, but only for the homescreen, when you choose an own picture for the homescreen background - tf3d crops it, adds grain and compression.
enable your background of the homescreen back to standard, because the manila-background is the background4alltabs now and you can't see the difference anymore if you switch from homescreen-tab to the others.
4a087e41_manila
Hi, AlecDelorean do you have the original file of 4a087e41_manila and 5c9aa261_manila? thanks a lot.
haha
tired of messing around with the backgrounds?
you need only one. 4a087e41_manila is a new image file for background4alltabs, 5c9aa261_manila is a script that was changed.
Hey AlecDelorean, can you do this for me as well.. Thanks!
I have just one question...
HOW do i get rid of the black curtain on top of the screen??
please please please say me how!!!
In nearest future we wont use this method. A real background for all pages done.
mun_rus said:
In nearest future we wont use this method. A real background for all pages done.
Click to expand...
Click to collapse
Our saviour is back! Hope your feeling well now..
@ ArchonX
ArchonX said:
I have just one question...
HOW do i get rid of the black curtain on top of the screen??
please please please say me how!!!
Click to expand...
Click to collapse
hey ArchonX,
this is the version of NoCurtains that is working for me:
Hello,
i have an application, programmed in C#. I wanna that the size of the gui will automatically adapt to the size of the phone on which the application get used.
How can I do this?
In the Paint() event of the form examine its ClientSize property. This is the size of the client (White) area of the screen. It is itself a Size object with Height and Width integer properties, this.ClientSize.Width and this.ClientSize.Height
Use these values to position/resize your objects on the screen, by changing their Size and Location (Left and Top) properties, so that they fit in this area.
This event occurs before the Paint() event of the child objects, so they will be repositioned/resized before they themselves are drawn.
To be clever, reposition and resize screen objects, scaled to the screen size at run time, not values hardcoded at development time.
This technique can also detect a change of orientation, the values of Height and Width change over! If you want to be smart, handle this as well, and your app should be starting look pretty damned professional. A bit of work and it should look good on all screen sizes. Test them out against the SDK's emulator images for a range of device screen sizes.
The following code example positions the label in the correct place. Hey Diddle Diddle, slap bang in the middle!
Code:
private void Form1_Paint(object sender, PaintEventArgs e)
{
label1.Left = (this.ClientSize.Width - label1.Size.Width) / 2;
label1.Top = (this.ClientSize.Height - label1.Size.Height) / 2;
label1.Text = this.ClientSize.Width.ToString() + " x " + this.ClientSize.Height.ToString();
}
do you have to do this with every object you put on it? Seems like a lot of code. (also im doing this in VB so far..)
I'm afraid so. But it's worth the effort. Also it will run on all screen sizes, see image, and also the oddball ones they haven't thought of yet!
Change 'this.' to 'me.' and omit the C# end of line character ';' and it's now in VB.
Does your form property AutoScaleMode is set to AutoScaleMode.Dpi?
For controls set the anchor property (default is top|left) also to right (and/or bottom if needed). That will automatically 'stretch' the controls.
Advanced:
Now, if you really want to support different resolutions it will take much more work:
As already mentioned you have to rearrange the controls on orientation changes. Take a look at Developing Orientation and dpi Aware Applications for the .NET Compact Framework!
And finally you have to provide images in different resolutions.
Adapt to New Screen Orientations and Resolutions
Of course you have to decide if this is really needed for your app as this will take much more time.
Does anyone know if it's possible to change the settings of the image viewer so that when you edit (and crop) an image, it does not also re-scale the image size.
For instance, I take a picture at 3264x1836.
I then crop (using the default image viewer (gallery)) a section covering approx 80% of the image and the image that gets saved is 702x367.
Unscaled this should have been something like 2800x1400 (or similar).
I want (and need) to be able to control this scaling myself. The reduction in size is so severe in the default editor is pretty much useless for me.
I tried several other photo editors, and they behaved in a similar way. The closest I've got is Resize-Lite - but even that one scales down to 720p settings.
Any ideas?
Just installed MIUI and having the same issue...
never had with cyanogen or sense...
any ideas?
Hi, I'm developing a material design calculator but I have a problem: How could I do to adapt buttons to alla screen size? For example on mi Xperia S buttons are too small! If you want screenshot or the xml code tell me it. I'm sorry for my bad english I'm only 14 XD
Hi,
You need to use the size in DP instead of PX and use max/min size attribute on your XML file
Start using dp (density independent pixels), they are designed to scale a graphic to "real-life size" for example 48dp is a little bigger than the size of our fingers and is the recommended size for buttons in order to be easily touchable.
If you need more info about density independent pixels read from Android Developer's page "Supporting Different Densities" (I'm new here and I can't post URLs, just google it).
At first you need to read "Support multiple screens" article on android developer website.
For my opinion the best way is to use wrap_content match_parent instead of pixels.
Hi,
Since you mentioned you're making a calculator app, while using "dp" for button dimensions, I also suggest you look into using "weights".
These can evenly space out your buttons in a layout.
To use weights in Android, your content must be wrapped in a LinearLayout.