From ff7c6c9c36b1501707625fea6c5acd3576cc54ca Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 26 Jan 2000 19:26:02 +0000 Subject: [PATCH] Corrected TIFF, more drawing tests. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 3 ++- distrib/msw/tmake/unx.t | 1 + samples/drawing/Makefile.in | 2 +- samples/drawing/drawing.cpp | 52 ++++++++++++++++++++++++++++++++----- src/common/imagtiff.cpp | 2 +- 5 files changed, 51 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2b3db633ff..8d4b38b8d9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# This file was automatically generated by tmake at 23:04, 2000/01/24 +# This file was automatically generated by tmake at 23:25, 2000/01/24 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T! # @@ -3139,6 +3139,7 @@ SAMPLES_DIST: cp $(SAMPDIR)/image/*.cpp $(DISTDIR)/samples/image cp $(SAMPDIR)/image/horse.* $(DISTDIR)/samples/image cp $(SAMPDIR)/image/smile.xbm $(DISTDIR)/samples/image + cp $(SAMPDIR)/image/smile.xpm $(DISTDIR)/samples/image mkdir $(DISTDIR)/samples/internat mkdir $(DISTDIR)/samples/internat/de diff --git a/distrib/msw/tmake/unx.t b/distrib/msw/tmake/unx.t index dfbd9cce12..0c067491cf 100644 --- a/distrib/msw/tmake/unx.t +++ b/distrib/msw/tmake/unx.t @@ -1083,6 +1083,7 @@ SAMPLES_DIST: cp $(SAMPDIR)/image/*.cpp $(DISTDIR)/samples/image cp $(SAMPDIR)/image/horse.* $(DISTDIR)/samples/image cp $(SAMPDIR)/image/smile.xbm $(DISTDIR)/samples/image + cp $(SAMPDIR)/image/smile.xpm $(DISTDIR)/samples/image mkdir $(DISTDIR)/samples/internat mkdir $(DISTDIR)/samples/internat/de diff --git a/samples/drawing/Makefile.in b/samples/drawing/Makefile.in index afb37464f2..096b91511f 100644 --- a/samples/drawing/Makefile.in +++ b/samples/drawing/Makefile.in @@ -16,7 +16,7 @@ program_dir = samples/drawing PROGRAM=drawing OBJECTS=$(PROGRAM).o -DATAFILES=pat4.bmp pat35.bmp pat36.bmp +DATAFILES=pat4.bmp pat35.bmp pat36.bmp image.bmp mask.bmp include ../../src/makeprog.env diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 0fe06ad96e..033c391e33 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -254,9 +254,12 @@ bool MyApp::LoadImages() if ( !path ) return FALSE; gs_bmpMask.LoadFile(path, wxBITMAP_TYPE_BMP); - gs_bmpMask.SetDepth(1); + +// This is so wrong, it hurts. +// gs_bmpMask.SetDepth(1); +// wxMask *mask = new wxMask(gs_bmpMask); - wxMask *mask = new wxMask(gs_bmpMask); + wxMask *mask = new wxMask(gs_bmpMask, *wxBLACK); gs_bmpWithMask.SetMask(mask); mask = new wxMask(gs_bmpWithColMask, *wxWHITE); @@ -566,13 +569,50 @@ void MyCanvas::DrawDefault(wxDC& dc) dc.DrawIcon( wxICON(mondrian), 410, 40 ); - // test the rectangle drawing - there should be no pixels between the rect - // and the lines + dc.SetBrush( *wxBLACK_BRUSH ); dc.SetPen(*wxTRANSPARENT_PEN); + dc.DrawRectangle( 0, 100, 1000, 300 ); + + // test the rectangle outline drawing - there should be one pixel between + // the rect and the lines + dc.SetPen(*wxWHITE_PEN); + dc.SetBrush( *wxTRANSPARENT_BRUSH ); + dc.DrawRectangle(100, 170, 49, 29); + dc.DrawRectangle(150, 170, 49, 29); + dc.SetPen(*wxWHITE_PEN); + dc.DrawLine(200, 160, 200, 210); + dc.DrawLine(100, 200, 210, 200); + + // test the rectangle filled drawing - there should be one pixel between + // the rect and the lines + dc.SetPen(*wxTRANSPARENT_PEN); + dc.SetBrush( *wxWHITE_BRUSH ); + dc.DrawRectangle(300, 170, 49, 29); dc.DrawRectangle(350, 170, 49, 29); - dc.SetPen(*wxRED_PEN); + dc.SetPen(*wxWHITE_PEN); dc.DrawLine(400, 160, 400, 210); - dc.DrawLine(340, 200, 410, 200); + dc.DrawLine(300, 200, 410, 200); + + // test the rectangle outline drawing - there should be one pixel between + // the rect and the lines + dc.SetPen(*wxWHITE_PEN); + dc.SetBrush( *wxTRANSPARENT_BRUSH ); + dc.DrawRoundedRectangle(100, 270, 49, 29, 6); + dc.DrawRoundedRectangle(150, 270, 49, 29, 6); + dc.SetPen(*wxWHITE_PEN); + dc.DrawLine(200, 260, 200, 310); + dc.DrawLine(100, 300, 210, 300); + + // test the rectangle filled drawing - there should be one pixel between + // the rect and the lines + dc.SetPen(*wxTRANSPARENT_PEN); + dc.SetBrush( *wxWHITE_BRUSH ); + dc.DrawRoundedRectangle(300, 270, 49, 29, 6); + dc.DrawRoundedRectangle(350, 270, 49, 29, 6); + dc.SetPen(*wxWHITE_PEN); + dc.DrawLine(400, 260, 400, 310); + dc.DrawLine(300, 300, 410, 300); + } void MyCanvas::DrawText(wxDC& dc) diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 088dd14979..4fb132a42d 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -193,7 +193,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos for (uint32 i = 0; i < h; i++) { - for (uint32 j = 0; j < h; j++) + for (uint32 j = 0; j < w; j++) { unsigned char alpha = (unsigned char)TIFFGetA(raster[pos]); if (alpha < 127) -- 2.45.2