Syndicate content

image

HTML background that fits the screen

You can actually define an image or a background (with CSS) that fits the area in which is it shown.

For a simple image use a width of 100%, then the browser computes the height for you.

  <div class="header"><img src="images/background.png" width="100%"></div>

This code will make the image width match the width of the <div> tag. Assuming the <div> tag fits the screen width, it will show in the full width, stretching as required.

When trying to do that with a background image in CSS, you want to use the background-size parameter ...

Fast render from image A to image B using alpha for blending

The attached package currently includes a C function and a SIMD function that both are used to blend two images together.

At this point I do not like the fact that the result is invalid (1 off with large values—if you have an alpha of 255, then you are likely to get the source component value minus 1). Outside of that, it works nicely and it is VERY fast.

I can blend 3,300 NTSC images per second with my i5 (Intel(R) Core(TM) i5 CPU 760 @ 2.80GHz.) With my newer computers I can run 3,750 NTSC images per second. These have Xeon processors (Intel(R) Xeon(R) CPU E31220 @ 3.10GHz.) The ...

QEMU tricks and reference

Today I tried to run WinXP on my newly upgraded Linux Ubuntu 12.04. It did not work... that's because the aqemu graphical interface tries to run qemu which was replaced with specially named emulators: qemu-i386, qemu-system-x86_64, etc. (try ls /usr/bin/qemu* to see a complete list on your system.)

So... I got the command line from the aqemu graphical interface, did a copy / paste and replaced the name with qemu-system-i386 and got the emulator started as expected. That worked fine, but then the window remained small (640x480) which I wouldn't care much if I weren't really using ...

Quickly saving an image to disk without extra library

Often, when I work with some form of graphics, I do not have a handy library to save the image buffer I'm working with in a file on disk. In most cases, when I want to do that, I make use of the Targa format. This is very easy to save since the header is very simple (18 bytes) and the data can be saved verbatim. Plus, many tools, such as the Gimp, can read the result at once.

Here is my C code to do so. It will work in C++ also. It should be easy to tweak for other languages such as C#.

{
  unsigned char hdr[18]; // the targa file header
  FILE *f;

  memset(hdr, 0, sizeof(hdr));  ...

Epson 1260 (and others) and Linux

As I started using my Epson 1260 Photo scanner on my Linux box, I got some problems...

The first scan works perfectly, and then on the second and following weird colors start appearing. Usually it is red or green, some sort of a gradient. At times half the page is like that, at times more, at times it's like a gradient...

Searching, some people said that the iscan driver was bad. Not true. The driver works perfectly.

Not too sure where the problem really is, looks like the buffer used to read the data is not correctly cleared before we read the next image. That is, in the video tool I ...

A button on the edge (HTML)

Today I played around with my feedback button (a button that sticks on the edges.)

The one I had worked on manually was fixed on the edge just fine, even in Internet Explorer.

Today, I felt like testing a few more things and thus tested with some HTML code. The code was very simple, a few paragraphs, one div with the feedback button, and a few more paragraphs. The style for the feedback button was in the <style> block in the header.

It worked just find in SeaMonkey and I found something of interest! (see below) but the position of the feedback button was fixed.

  ...
  position:

Older Internet Explorer (v7 and older) background leakage...

I worked on a site a week ago or so and checked it with IE 8 but not IE 7...

The customer then contacted me saying that some images were "completely" off. (about 30 pixels)

The image being off was actually centered. IE 7 and older does NOT properly reset the text-align CSS settings. So the parent setting leaks in the children instead of the chidren using the default as they should. So that one was easy, I just added a text-align: left; in the next <div> statement and got that to work right!

Code references

The following are three distinct nodes using geshifilter which is a filter used in Drupal (and other systems) to transform the content of the node from code to colorful HTML.


And here is the end of this page (from the <hr> to the bottom)

Draw circle

void Image::DrawCircle(float x, float y, float radius)
{
  // TODO: add tests to prevent computing all the points for nothing
  //       (i.e.

OpenOffice Presenter

Already used OpenOffice? This is a free office suite just like Microsoft Office (or MS Office). It does not include absolutely everything, but it has most certainly a lot more than you need!

Syndicate content Syndicate content

Diverse Realty

Diverse Realty Team

Want a New Home?
Want to Sell Your House?

Call Alex at
+1 (916)
220 6482

Alexis Wilke, Realtor
Salesperson
Lic. # 02024063

Cory Marcus, Broker
Lic. # 01079165

     

Terms of Site Index

Find the page/content you are looking for with our index.

  • Apache
    Apache is the most well known Open Source Web Server.
  • Ubuntu

    A Linux distribution based on Debian and born in Switzerland.

  • basics
  • core
  • leak