• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 482
  • Last Modified:

Print Bitmap like a vector Image

I have a Bitmap Image, and it's size about 600x600 pixels.
When I print it on A4 paper by strechdraw, it looks blurry and texts enlarges.
Is there any way to print it like a vector Image.
Or kind of solution?
The line should be same thickness, and the text must be same size.
Does anybody have a good idea?

0
Heesu
Asked:
Heesu
1 Solution
 
sfockCommented:
I fear what you want is not possible. Except of you are able to write "intelligent" code that is able to identify objects in a bitmap something like OCR but not only for text but all kinds of objects ...
sorry but a bitmap is nothing than a bunch of pixels in different colors the "sense" within is made by the brain of the one who is looking at it, if you can rebuild this you'll not only solve your problem you'll advance to one of the guru's of AI ;-)

The strechdraw alogrhytems work without a knowlege of the "sense" of a picture. They do just add or remove some pixels by "guessing". In this way they usually make accepable results if you scale in the same dimensions eg. from 600x600 to 1200*1200 but their results are usually fair if you change the dimansions like 600x600 to 800x1200

sorry for that
0
 
HeesuAuthor Commented:
OK
Then, does anyone know the best way to print a bitmap image clearly?
For example, when I print a windows metafile, it looks good.
If possible, I want to change the bitmap to metafile then it may not look blurry, right?
I think there may be a way to change a bitmap to metafile.
Does anyone have idea?
Thanks,

Heesu.

0
 
sfockCommented:
sorry i only can repeat me.

metafile -> Bitmap -> No Problem
Bitmap -> metafile -> Big Problem
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
HeesuAuthor Commented:
sfock:

I am drawing contour lines, but the algorithm draws lines pixel by pixel.
I want to change that algorithm as a metafile, if possible.
Could you explain a little bit, how I can draw the metafile?
Thanks and sorry keep bugging you.

Heesu.

0
 
HeesuAuthor Commented:
What if I make a big virtual canvas, and draw the image?
I think it maight be helpful to make more clearer image?
What do you think about it?
0
 
sfockCommented:
well okay, if the Bitmap is not your Source, then you can create a Metafile with the Class TMetafile.

To write/Paint into it you have to use the Windows gdi (Drawing) functions like

TextOut(myMetafile.Handle, //HDC hdc,     // handle of device context
    10, //int nXStart,     // x-coordinate of starting position  
    10, //int nYStart,     // y-coordinate of starting position  
    StrPCopy('Hello WMF'),//LPCTSTR lpString,     // address of string
    9//int cbString      // number of characters in string
   );

Refer the Microsoft SDK Documentation for details
0
 
HeesuAuthor Commented:
I don't know about StrPCopy or myMetafile because I am a beginner.
Could you give me a more specific example?
Your's look like drawing text.

Thanks.

Heesu.
0
 
sfockCommented:
Yes you are right, in this example i am drawing a Text with a gdi-api function. You can also relace it with functions like FrameRect or something like that. I'd please you to refer the Microsfot Windows SDK Help for further details.

"myMetafile" was a synonym for an instance of the class TMetafile.(Wich i expected you'd create). After using the api seems not to be the best alternative for a beginner, I'll try an more explicit example of an easier way. You can use the classes TMetafile and TMetafileCanvas to paint the Metafile like this:

var
  emf : TMetafile;
begin
  emf := TMetafile.Create;
  try
    with TMetafileCanvas.Create(emf, 0) do begin
      try
        Brush.Color := clRed;
        Ellipse(0,0,10,10);
      finally
        Free;
      end;
    end;
    emf.SaveToFile('c:\myFirstBitmap.emf');
  finally
    emf.free;
  end;

Belonging to StrPCopy i'd suppose to open Delphi choose the menu help, then choose menu item Delhi Help (The F1 Key is able to do the same a bit easier) and change to the tab page index enter "StrPCopy" select the topic and read.
I'd also admit to continue reading the related topics mentioned at this topic.

For any details unlear with the class TMetafile go ahead like for details to StrPCopy but don't enter "StrPCopy" but "TMetafile" as search expression. ;-)

0
 
CleanupPingCommented:
Heesu:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
kacorretiredCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept sfock's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now