|
Hi, im trying to draw text from a richtextbox into an image, using the drawtobitmap method but my problem is the image file doesnt print everything, it just print the control without anythin, can someone please help, here is my code.
Bitmap bi = new Bitmap(this.rtfbody.Width + 200, this.rtfbody.Width + 200);
bi.SetResolution(3000, 3000);
Control rf = new Control();
// rf = rtfbody.CreateControl();
// rtfbody.CreateGraphics();
rtfbody.DrawToBitmap(bi, new Rectangle(0, 0, rtfbody.Width + 200, rtfbody.Height + 200));
bi.Save(@"c:\abc.bmp",ImageFormat.Bmp); //, PixelFormat.Format24bppRgb);
|
|
|
|
|
1. Get a snapshot of the screen using Graphics.CopyFromScreen()
2. Find the coordinates of the RichTextBox on the screen using PointToScreen()
3. Copy the corresponding portion of the screen snapshot onto your bitmap.
|
|
|
|
|
and hope there's no other window on top of it.
|
|
|
|
|
omlac,
Does "rtfbody" have any text in it?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
yes rtfbody has got text and i pasted a picture in it, that i want to be saved.
|
|
|
|
|
|
thanks very much the your help. the links looks like its perfect but will i be able to send it to a file, i dont seem to find where the file is saved.
|
|
|
|
|
i have discovered that the file is saved through windows dialogue(directory) box. but i didnt want users to do this.
is there another way of doing this.
|
|
|
|
|
<!-- language: lang-vb -->
Panel1.Dock = DockStyle.None ' If Panel Dockstyle is in Fill mode
Panel1.Width = 5000 ' Original Size without scrollbar
Panel1.Height = 5000 ' Original Size without scrollbar
Dim bmp As New Bitmap(Me.Panel1.Width, Me.Panel1.Height)
Me.Panel1.DrawToBitmap(bmp, New Rectangle(0, 0, Me.Panel1.Width, Me.Panel1.Height))
'Me.Panel1.DrawToBitmap(bmp, Panel1.ClientRectangle)
bmp.Save("C:\panel.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Panel1.Dock = DockStyle.Fill
**Note:** Its working fine
I have no idea for printing but I think it will be useful to you
Regards
R Muruganandhan
ShipNet Software Solutions India Pvt Ltd, Chennai
|
|
|
|
|
I want to export my tree view data into different format like -
- PDF
- tiff
- Word
- Html
- Excel
using C#..
If anyone know anything it will be appreciable ..
Thanks in advance..
|
|
|
|
|
Are you sure you know what you really want here? tiff is an image format, how would you show a tree view in pdf/word/excel? In html you would probably want a mixture of text and images.
I think you need to redefine what you are trying to achieve.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hey Bob,
I have a tree control and the data which displayed in that tree control I need to Export into "Pdf, tiff, Html, Word and Excel"...
I think this will clear my question to you...
|
|
|
|
|
Well, there is no simple answer. All of these formats require significant coding which you will need to research individually. Writing to MS applications is relatively simple, writing to HTML is just a case of putting the applicable tags around your data etc.
I think Google is about to become your new best friend
Bob
Ashfield Consultants Ltd
|
|
|
|
|
You can do this using reporting services. But you will need to get the data from database using query representing your tree view.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
can u please give some more idea..
I have a tree control and data displayed in that tree I want to Export in different Format --"Pdf, tiff, Word, Html and Excel"...
This is what I want to implement...
Thanks for ur hint..
|
|
|
|
|
Exactly HOW are you meant to export as tiff... ?
Ok, I understand you CAN draw the text onto the image... But you won't be able to IMPORT it without some Text Recognition Software...
http://en.wikipedia.org/wiki/TIFF[^]
"Tagged Image File Format (abbreviated TIFF) is a file format for storing images, including photographs and line art."
-= Reelix =-
|
|
|
|
|
I have a tree control and Data inside My tree control as a whole I want to export.. I want to export it in the format I have specified..
|
|
|
|
|
hi,
If you don't want to spend time take a look at controls of devexpress.
It cost some money but i guess the time you need to write it is more expensive.
FE : The devexpress grid exports all formats you need.
otherwise : Not sure but for tiff you need to change the canvas to bitmap en convert it to tiff.
a panel has a draw to bitmap so here's a piece of my code :
Bitmap Tmp_Bitmap = new Bitmap(Designer.Width, Designer.Height);
Designer.DrawToBitmap(Tmp_Bitmap, new Rectangle(0, 0, Designer.Width, Designer.Height));
e.Graphics.DrawImageUnscaled(Tmp_Bitmap, new Point(0, 0));
greetz
Kurt
greetz
Kurt
|
|
|
|
|
hi,
i need ur help >>>
i want to open the structure of microsoft word document 2003 ,the hrader (FIB) and text and the others parts from my C#2003 program how???
can i use
1- dll functions to call the header and other parts? or it will conflent with word functions and not open??
2- or i have to find another method ????
can u help me bez. i drive to block way
and i use the hexeditor program to view the address >>>>>>
Amani
MSC.student
|
|
|
|
|
|
thanx
realy it have this pfd. but i didn't know from i begin and how can i handle it in programming using c# 2003
from i begin ? what i use it ?
i didn't find who help me
bez this pdf. i fond it very complex and i can't interst with it????
can u help me for more oriention???
|
|
|
|
|
Your questions make NO sense. Please do not use text speak.
|
|
|
|
|
In c# i need to an icon so that in the add or remove programs list instead of the internet explorer image i should be able to see the application's icon
|
|
|
|
|
I think you need to elaborate your question a little bit more. Do you want to change the icon of another program or your own program? If it is for your own program, have you assigned an icon to the application. Does the exe have a default icon or a custom icon?
|
|
|
|
|
I might confuse you a little now... The icon that i am talking about should be reflected in the add or remove programmes.. i.e i build the project and create a setup.. when i install the setup i want My Icon to come in the Add/Remove programmes in the control panel? Is this possible? Thanks a lot for the response...
|
|
|
|