Click here to Skip to main content
15,923,689 members
Home / Discussions / C#
   

C#

 
GeneralRe: DragDrop registration failed Pin
Heath Stewart13-May-04 3:03
protectorHeath Stewart13-May-04 3:03 
GeneralGDI+ Image from Graphics Pin
mhmoud rawas12-May-04 22:10
mhmoud rawas12-May-04 22:10 
GeneralRe: GDI+ Image from Graphics Pin
sprout7412-May-04 22:31
sprout7412-May-04 22:31 
GeneralRe: GDI+ Image from Graphics Pin
mhmoud rawas12-May-04 23:35
mhmoud rawas12-May-04 23:35 
GeneralRe: GDI+ Image from Graphics Pin
Heath Stewart13-May-04 3:01
protectorHeath Stewart13-May-04 3:01 
GeneralRe: GDI+ Image from Graphics Pin
mhmoud rawas13-May-04 4:19
mhmoud rawas13-May-04 4:19 
GeneralRe: GDI+ Image from Graphics Pin
Heath Stewart13-May-04 4:50
protectorHeath Stewart13-May-04 4:50 
GeneralRe: GDI+ Image from Graphics Pin
mhmoud rawas14-May-04 19:45
mhmoud rawas14-May-04 19:45 
Dear Heath

first of all thanks for giveing me your time,

the last caode which i have wrtie was just for testing i know that it is not applicable to save a picture in a paint event but as l have told you that is was just for testing.

i have tryed your code but as i think it did not do the job i want, actually i have a paint event which will take a long time so i would like to draw it on the form or control bordar then i would like to capture an in=mage from the drawn control to redraw it just for refreshment with out changing the drawing zoom, when i have tryed your sample it just draw the image and dont draw on the control as i want let me give you this -sample-

protected override void OnPaint(PaintEventArgs e)
{
  e.Graphics.Clear(Color.White);
  DateTime dt = DateTime.Now;
  for ( int i = 0 ; i < 600 ; i++)
    for ( int j = 0 ;  j < 600 ; j++)
    {
       e.Graphics.DrawLine(Pens.Blue , i,j,i+3,j+3);
    }
    label1.Text = ((TimeSpan)(DateTime.Now - dt)).TotalMilliseconds.ToString() ;
    base.OnPaint (e);
}
private void button1_Click(object sender, System.EventArgs e)
{
  using (Graphics g1 = CreateGraphics())
  {  
    using (Bitmap bmp = new Bitmap(Bounds.Width, Bounds.Height, g1))  
    {    
      using (Graphics g2 = Graphics.FromImage(bmp))    
    {      
    PaintEventArgs ee = new PaintEventArgs(g2, Bounds);      
    OnPaint(ee);    
  }    
  bmp.Save("C:\\Tt.BMP");  
}

so if you try it you will find that when you click the button it will just draw the image not both image and control,

be carfull i would like from you to test the last sample using control paramater double buffer to false,

also i need something if -and only if- we set double buffer to true how can we reach the buffer where it seems like if we create a fixed HDC for the control and we can draw use it as a source in BitBlt function, so if we can create an image based on that buffer it will be great.

finally for give me for the long replay but i have search for it in the MSDN and i could not get any information about this problem so i appreciate your help

Regards,

Mhmoud Rawas
------------
Software Eng.
GeneralRe: GDI+ Image from Graphics Pin
Heath Stewart16-May-04 11:17
protectorHeath Stewart16-May-04 11:17 
Generalregd richtextbox and datagrid Pin
karteek12-May-04 21:47
karteek12-May-04 21:47 
GeneralRe: regd richtextbox and datagrid Pin
Heath Stewart13-May-04 2:58
protectorHeath Stewart13-May-04 2:58 
Generalfirewall Pin
shahrokh nabavi12-May-04 21:07
shahrokh nabavi12-May-04 21:07 
GeneralRe: firewall Pin
Colin Angus Mackay12-May-04 23:26
Colin Angus Mackay12-May-04 23:26 
GeneralRe: firewall Pin
walker_net23-Jun-04 22:54
walker_net23-Jun-04 22:54 
GeneralRe: firewall Pin
Colin Angus Mackay23-Jun-04 23:03
Colin Angus Mackay23-Jun-04 23:03 
GeneralTable problem (Xml) Pin
bertcox12-May-04 20:40
bertcox12-May-04 20:40 
GeneralRe: Table problem (Xml) Pin
Aryadip12-May-04 21:20
Aryadip12-May-04 21:20 
GeneralScroll Bar Pin
sreejith ss nair12-May-04 19:18
sreejith ss nair12-May-04 19:18 
GeneralRe: Scroll Bar Pin
Heath Stewart13-May-04 2:54
protectorHeath Stewart13-May-04 2:54 
GeneralText Readers, Streams, *ugh* Pin
gUrM33T12-May-04 17:42
gUrM33T12-May-04 17:42 
GeneralRe: Text Readers, Streams, *ugh* Pin
Paul Watson12-May-04 21:23
sitebuilderPaul Watson12-May-04 21:23 
GeneralRe: Found an alternate way ... Pin
gUrM33T13-May-04 0:23
gUrM33T13-May-04 0:23 
GeneralRe: Text Readers, Streams, *ugh* Pin
Heath Stewart13-May-04 2:52
protectorHeath Stewart13-May-04 2:52 
GeneralRe: Text Readers, Streams, *ugh* Pin
Mike Dimmick13-May-04 4:37
Mike Dimmick13-May-04 4:37 
GeneralRe: Text Readers, Streams, *ugh* Pin
gUrM33T13-May-04 14:57
gUrM33T13-May-04 14:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.