Corrected TIFF,

more drawing tests.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2000-01-26 19:26:02 +00:00
parent cf27ef009f
commit ff7c6c9c36
5 changed files with 51 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)