JPEG et RTF

  • Thread starter Thread starter Thierry
  • Start date Start date
T

Thierry

Hi all,

I'm programming a Knowledge Base application (VB 2005, Framework 2.0).
I integrated a RichTextBox control so I can insert pictures. The problem now
is the size of the saved document ! Images are stored under the BMP format.

Is there a way to store the images under a smaller format (like JPEG) ?
If yes, how ? (I googled but couldn't find something really interesting).
If no, do you know of something that could handle this ?

Thanks,
Thierry
 
Thierry said:
I'm programming a Knowledge Base application (VB 2005, Framework 2.0).
I integrated a RichTextBox control so I can insert pictures. The problem
now is the size of the saved document ! Images are stored under the BMP
format.

Is there a way to store the images under a smaller format (like JPEG) ?
If yes, how ? (I googled but couldn't find something really interesting).
If no, do you know of something that could handle this ?

Why not save the entries in HTML format and use the WebBrowser control to
display them?
 
Using HTML was also an idea and I was looking for a nice (free) HTML editor
that I could integrate within my app.
So far, I didn't find any ....
 
Yes. Use the system.drawing.imaging namespace

Dim bm as Bitmap = New Bitmap("c:\mypictures\pic1.bmp")
bm.Save(c:\myimages\"pic1.jpg", ImageFormat.Jpeg)

I think there is also something that lets you change the image
compression ratio, but not sure about that.
 
Yes, using the system.drawing.imaging namespace. Try something like
the following:

Dim bm as Bitmap = New Bitmap("c:\myimages\pic1.bmp")
bm.Save("c:\myimages\pic1.jpg", ImageFormat.Jpeg)

Bill
 
Rinze,
Nonsense. You can display an image just fine without using tables

You say that I can do that, but I really don't know how, can you show me
how?.

(Nicely non fixed dynamicly on a page of course)

Cor
 
Cor Ligthert [MVP] schreef:
Rinze,


You say that I can do that, but I really don't know how, can you show me
how?.

(Nicely non fixed dynamicly on a page of course)

Cor

Very very basic example:

<html>
<body>
<img src="urltoimage">
</body>
</html>


Ofcourse there's some doctype tags missing etc, but you get the point.
No tables in the code. You can even use DIV tags to move stuff around
the page.
 
I think I didn't explain correctly :

I want to enable a user to type text (allowing text format of course),
insert pictures (from file and from the clipboard) into a control (like the
RichTextBox control).

The problem is that the RichTextBox saves the picture as a bitmap BMP field
and takes tons of megabytes.

After looking at RTF specification
(http://www.biblioscape.com/rtf15_spec.htm#Heading49) I noticed the field
<picttype> and I don't understand why the RichTextBox control doesn't keep
for original format. Is it a MS spec ?

Among other solutions, I looked :
- OpenXml but it needs framework 3.0
- Word document but it needs Word to be installed
- MTHML but I couldn't find source code for such a control (including
copy/paste from the clipboard)

Here's where I'm now ....
 
Rinze,

In your first example it is bound left to the top of the page.

In your Div sample you can change AFAIK the only the hight place.

And that is it,

You can of course use containers, as you see them than at the end as source,
than you are mostly looking again to tables. <Table><tr><td>

(If you look at the VB-Tips on our webpage, that is that a fixed part, what
can be placed everywhere and will be always there, but that cannot be the
meaning).


Cor
 
Cor Ligthert [MVP] schreef:
Rinze,

In your first example it is bound left to the top of the page.

In your Div sample you can change AFAIK the only the hight place.

And that is it,

You can of course use containers, as you see them than at the end as source,
than you are mostly looking again to tables. <Table><tr><td>

(If you look at the VB-Tips on our webpage, that is that a fixed part, what
can be placed everywhere and will be always there, but that cannot be the
meaning).


Cor

Cor,

I suggest you look into CSS. You can use that to layout your site
without using tables. It's also possible to position an image just using
the image tag, for example:

<img src="urltoimage" width="100" height="100" border="0"
style="position: absolute; top: 56px; right: 80px" />

Or create layers with the div tag and move them around the webpage.
There's so much you can do with CSS you really don't need tables
anymore. Benefit of this is that if you want to change your layout you
only have to change 1 file, the CSS file you include in your webpages.

example 3 columns, no tables: http://www.glish.com/css/7.asp
 
Rinze,

I asked you in this thread a solution without setting it absolute, I find
absolute very bad to see.
(Nicely non fixed dynamicly on a page of course)

I have searched a long time for something and use all kind of things to
solve it.
This is a very old not maintaned webside from me.

http://huizen.ddsw.nl/bewoners/ligthert/

It is in Dutch, for you know problem, see how I play with the pictures.

Cor
 
Back
Top